xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Glavassevich <mrgla...@ca.ibm.com>
Subject Re: why is entity ref expanded in the internal subset (and related questions)?...
Date Mon, 10 Apr 2006 05:06:35 GMT
Hi Jacob,

Jacob Kjome <hoju@visi.com> wrote on 04/08/2006 01:32:28 AM:

<snip/>

> Why are the contents expanded?  Why not just give me "%BigEntity;" 
> from the original document?  Is there any recourse?

startParameterEntity() [1] and endParameterEntity() [2] notify you of the 
start and end of a parameter entity. You could just ignore the events in 
between them and write the entity reference instead of its replacement 
text. 
 
> A second problem is that reparsing this file gives me the following 
> parsing error...
> 
> test9.gen.xml:4: Error: White space is required after "<!ENTITY" in 
> the entity declaration.
> 
> The parse error seems to be with the external entity declaration 
> "%BigEntity".  If I change that to "% BigEntity", the parse error 
> goes away.  But, the "name" parameter passed to me in the 
> externalEntityDecl() method is exactly "%BigEntity".  If the parser 
> knows it can't deal with that, why doesn't it pass me "% 
> BigEntity"?  Seems odd that I'd be forced to split the "%" apart from 
> the rest of the entiy name manually.

SAX requires that parameter entities be reported [3] with '%' prepended to 
their names. XNI adopted this naming convention since that's what SAX 
expects.

> thanks,
> 
> Jake
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org

[1] 
http://xerces.apache.org/xerces2-j/javadocs/xni/org/apache/xerces/xni/XMLDTDHandler.html#startParameterEntity(java.lang.String
, org.apache.xerces.xni.XMLResourceIdentifier, java.lang.String, 
org.apache.xerces.xni.Augmentations)
[2] 
http://xerces.apache.org/xerces2-j/javadocs/xni/org/apache/xerces/xni/XMLDTDHandler.html#endParameterEntity(java.lang.String
, org.apache.xerces.xni.Augmentations)
[3] 
http://xerces.apache.org/xerces2-j/javadocs/api/org/xml/sax/ext/LexicalHandler.html#startEntity(java.lang.String)

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Mime
View raw message