You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2003/03/12 18:32:35 UTC
DO NOT REPLY [Bug 17926] New: -
Parameter entity ref incorrect in non-normalized parameter entity text
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17926>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17926
Parameter entity ref incorrect in non-normalized parameter entity text
Summary: Parameter entity ref incorrect in non-normalized
parameter entity text
Product: Xerces2-J
Version: 2.3.0
Platform: Other
OS/Version: Windows NT/2K
Status: NEW
Severity: Normal
Priority: Other
Component: XNI
AssignedTo: xerces-j-dev@xml.apache.org
ReportedBy: mpalandri@lspeed.com
I have been using the org.apache.xerces.parsers.XMLDocumentParser class to
parse XML documents for storage into an XML repository. To get a better idea of
how this class calls the event methods, I extended it and just had the event
methods generate logging output. Everything was working fine until I sent my
parameter entity test document through and ran into what I believe is a bug.
The problem appears in the non-normalized text of an internal parameter entity
declaration (pe2) that contains a parameter entity reference (to pe1). I
expected the non-normalized text to merely contain the reference, but it has
both the reference and the referenced entity's text, one after another. The
text value is correct; It only contains the referenced entity's text and no
entity reference.
If this isn't a problem, then how do I go about getting the entity reference
but not the referenced entity's text in the non-normalized text? Is there some
feature that affects this?
I have minimized the test case and it is as follows:
bug.xml
-------------------------------------------------
<!DOCTYPE foo SYSTEM "bug.dtd">
<foo/>
-------------------------------------------------
bug.dtd
-------------------------------------------------
<!ELEMENT foo EMPTY>
<!ENTITY % pe1 "This is the value of pe1">
<!ENTITY % pe2 "Entity pe2 references pe1: [%pe1;]">
-------------------------------------------------
output
-------------------------------------------------
XMLScanner: startDocument
XMLScanner: locator:
XMLScanner: publicId: null
XMLScanner: literal systemId: file:///C:/Sample%20Files/xml/bug.xml
XMLScanner: expanded systemId: file:///C:/Sample%20Files/xml/bug.xml
XMLScanner: base systemId: file:///C:/Sample%20Files/xml/bug.xml
XMLScanner: line: 1
XMLScanner: column: 1
XMLScanner: encoding: [UTF-8]
XMLScanner: doctypeDecl
XMLScanner: rootElement: [foo]
XMLScanner: publicId: [null]
XMLScanner: systemId: [bug.dtd]
XMLScanner: startDTD
XMLScanner: locator:
XMLScanner: publicId: null
XMLScanner: literal systemId: bug.dtd
XMLScanner: expanded systemId: file:///C:/Sample%20Files/xml/bug.dtd
XMLScanner: base systemId: file:///C:/Sample%20Files/xml/bug.dtd
XMLScanner: line: 1
XMLScanner: column: 1
XMLScanner: startExternalSubset
XMLScanner: identifier:
XMLScanner: publicId: null
XMLScanner: literal systemId: bug.dtd
XMLScanner: expanded systemId: file:///C:/Sample%20Files/xml/bug.dtd
XMLScanner: base systemId: file:///C:/Sample%20Files/xml/bug.xml
XMLScanner: startContentModel
XMLScanner: elementName = [foo]
XMLScanner: empty
XMLScanner: endContentModel
XMLScanner: elementDecl
XMLScanner: contentModel: [EMPTY]
XMLScanner: internalEntityDecl
XMLScanner: name: [%pe1]
XMLScanner: text: [This is the value of pe1]
XMLScanner: nonNormalizedText: [This is the value of pe1]
XMLScanner: internalEntityDecl
XMLScanner: name: [%pe2]
XMLScanner: text: [Entity pe2 references pe1: [This is the value of pe1]]
XMLScanner: nonNormalizedText: [Entity pe2 references pe1: [%pe1;This is the
value of pe1]]
XMLScanner: endExternalSubset
XMLScanner: endDTD
XMLScanner: emptyElement
XMLScanner: startElement
XMLScanner: element: [foo]
XMLScanner: attributes:
XMLScanner: endElement
XMLScanner: element: [foo]
XMLScanner: endDocument
-------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org