Just to repeat an comment I made to another post, I think we need to
look at DSRL also generating ISO Catalogs. This allows us to remap
entity declarations rather than just rename them, which I think achieves
the same goal.
Presumably one motivation for entity renaming is so that we can merge
documents that use the same names for different entity definitions: such
as the maths characters whose definitions are contentious. Using
catalogs, each subdocument is first processed to expand the entities
using the appropriate catalog remapping, then they can be merged later.
Now this does not preserve the entity references, as renaming would, of
course. But I think that is too much to ask, because our project scope
is validation, not general purpose programming.
================================================================
As a side issue, if we want to transfer entity references in a document
for later validation, we could use something like this:
<!ENTITY nbsp CDATA "<?entref nbsp?>&#A0;<?end-entref?>" >
which would presumably be in XML
<!ENTITY nbsp CDATA "<?entref nbsp?>&#A0;<?end-entref?>" >
Schematron can validate PIs like this.
Cheers
Rick
Martin Bryan wrote:
> Murata-san
>
> >XML Infoset has Unexpanded Entity Reference Information Items
> and Unparsed Entity Information Items only. It does not provide entity
> declarations. Furthermore, unexpanded entity reference information
> Items occur only when entity references are not expanded. How do you
> apply renaming
> to entity declarations and expanded references to entities?
>
> The only way you can do it is to remove the entity declarations in the
> source file so that the entity references become unexpanded entity
> references. Not neat, but as I see it the only way to go. What I
> actually do is to create dummy entries for mapped entity names in a
> "entity definition translation" file and then require these to be
> manually edited to match the original entity exp[ansions as there is
> no way of getting at the declarations during parsing. But remember
> that what DSRL does in practice is create a set of rules to be applied
> to the source file. They ideally need to be applied before parsing and
> therefore entity expansion. This being difficult to do you have to
> presume some preprocessing. As entity sets are normally referenced
> rather than included in the local subset this becomes simple if you
> have a mechanism for redirecting references to the external file set.
>
> Martin
>
>
-- DSDL members discussion list To unsubscribe, please send a message with the command "unsubscribe" to dsdl-discuss-request@dsdl.org (mailto:dsdl-discuss-request@dsdl.org?Subject=unsubscribe)Received on Thu Apr 12 03:23:14 2007
This archive was generated by hypermail 2.1.8 : Thu Apr 12 2007 - 18:53:02 UTC