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 2001/03/07 15:10:35 UTC
[Bug 881] New - Parameter Entity string orphaned - later reference unabe to find string
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=881
*** shadow/881 Wed Mar 7 06:10:35 2001
--- shadow/881.tmp.5825 Wed Mar 7 06:10:35 2001
***************
*** 0 ****
--- 1,67 ----
+ +============================================================================+
+ | Parameter Entity string orphaned - later reference unabe to find string |
+ +----------------------------------------------------------------------------+
+ | Bug #: 881 Product: Xerces-J |
+ | Status: NEW Version: 1.3.0 |
+ | Resolution: Platform: All |
+ | Severity: Major OS/Version: All |
+ | Priority: Component: DTD |
+ +----------------------------------------------------------------------------+
+ | Assigned To: xerces-j-dev@xml.apache.org |
+ | Reported By: johne@miles33.co.uk |
+ | CC list: Cc: |
+ +----------------------------------------------------------------------------+
+ | URL: |
+ +============================================================================+
+ | DESCRIPTION |
+ Using the following simple DTD d.dtd
+
+ <?xml version='1.0' encoding='UTF-8' ?>
+
+ <!--Generated by XML Authority-->
+
+ <!ENTITY % global-attributes " id ID #IMPLIED">
+ <!ELEMENT THINGS (#PCDATA)>
+ <!ATTLIST THINGS URL CDATA #REQUIRED >
+
+ <!ELEMENT GOODSTUFF (#PCDATA)>
+ <!ATTLIST GOODSTUFF %global-attributes;
+ URL CDATA #IMPLIED >
+ <!ELEMENT TESTS (THINGS , GOODSTUFF)>
+
+ and the XML
+
+ <?xml version = "1.0" encoding = "UTF-8"?>
+ <!DOCTYPE TESTS SYSTEM "d.dtd">
+ <TESTS>
+ <THINGS URL = "d:/ddd/ddd/dd">My things are fun</THINGS>
+ <GOODSTUFF>Mygood</GOODSTUFF>
+ </TESTS>
+
+
+ The using the test frame of dom.traversal.TreeWalkerView the
+
+ <!ATTLIST GOODSTUFF %global-attributes;
+
+ does not load the correct 'global-attributes' parameter entity because it has
+ been orphaned by the line of code (and later overwritten by THINGS)
+
+ in src\org\apache\xerces\parsers\domparser.java
+
+ public void internalPEDecl(int entityNameIndex, int entityValueIndex)
+ throws Exception {
+
+ ...
+ ...
+
+ str.append("<!ENTITY % ");
+ str.append(fStringPool.toString(entityNameIndex));
+ str.append(" \"");
+ // bad str.append(fStringPool.orphanString(entityValueIndex));
+ //fix???
+ str.append(fStringPool.toString(entityValueIndex));
+
+
+ Hope this helps
+
+ John Eliasson - Miles33