Subject:SS5.3.179L: using references in xml Author:Hans-Peter Küchler Date:18 Oct 2004 06:25 PM
Hi,
please have a look at the ZIP file. Open the peref.prj. There are two different named filegroups:
peref_ref.* and peref_element.*. Both XML files are using an external parameter entity, used in the external subset of the DTD.
The element <V> begins in peref_element.ent and ends up in peref_element.dtd.
The reference & begins in peref_ref.ent and ends up in peref_ref.dtd.
peref_element.xsl will work as expected (with peref_element.xml) but peref_ref.xsl doesn't.
It has no practical importance for me, but I wonder why both case are handled different.
Btw. Saxon7 doesn't strip the text declaration from *.ent away. And have a look at xmlspy with both XML/XSL files;-)
Subject:Re: SS5.3.179L: using references in xml Author:(Deleted User) Date:20 Oct 2004 05:29 AM
Hi Hans-Peter,
the peref_ent.dtd is not a valid DTD because it splits an entity reference
across entities.
<!ENTITY txt "<![CDATA[%val;p;">
where %val; resolves to a string that ends with &am.
So, when the processors try to expand any entity found in the replacement
text, they find an invalid entity definition.
From the XML spec, § 4.5 "Construction of Entity Replacement Text"
[...]
The actual replacement text that is included (or included in literal) as
described above MUST contain the replacement text of any parameter entities
referred to, and MUST contain the character referred to, in place of any
character references in the literal entity value; however, general-entity
references MUST be left as-is, unexpanded
[...]
So the replacement text coming from the .ent file can contain general
entities that will be left untouched; but the &am string is just not
valid.