Hi Chris,
The relevant section of the XMLm 1.0 spec, 3rd edition:
[[
Well-formedness constraint: PEs in Internal Subset
In the internal DTD subset,
parameter-entity references
MUST NOT occur within markup declarations; they MAY occur where markup
declarations can occur. (This does not apply to references that occur in
external
parameter entities or to the external subset.)
]]
This says that you can't do what you're trying to do in the external
subset. If you were in the internal subset, and data_file's replacement
text began and ended with quotes, then you should be set. Note also that,
even in the external subset, you can't enclose the reference to data_file
in quotes, since the parser will then simply treat it as replacement text.
Hope that helps,
Neil
Neil Graham
Manager, XML Parser Development
IBM Toronto Lab
Phone: 905-413-3519, T/L 969-3519
E-mail: [EMAIL PROTECTED]
"Chris Surridge"
<Christopher.Surridge To: [EMAIL PROTECTED]
@titan.com> cc:
Sent by: news Subject: Question about external
entity references
<[EMAIL PROTECTED]>
08/16/2004 02:14 PM
Please respond to
xerces-c-dev
I'm using the SAXParser to parse a dtd that has entity definitions which
contain references to external text files -- for example:
<!ENTITY % data_file SYSTEM "data.txt">
<!ELEMENT data_element (#PCDATA)>
<!ATTLIST data_element data_attribute #FIXED '%data_file;'>
>From this, I expect a "data_element" element to have a "data_attribute"
attribute with a fixed value loaded from the "data.txt" file. Instead, the
"data_attribute" attribute ends up with the literal value "%data_file". As
far as I can tell, the EntityResolver is not even being called to resolve
the "data_file" entity. Do I need to do something different with the
SAXParser, or is the dtd bogus?
Thanks in advance,
--chris
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]