Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-858

multiple layers of entities

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Resolution: Fixed
    • 2.2.0
    • 2.3.0
    • DOM
    • None
    • Operating System: Linux
      Platform: PC
    • 18842

    Description

      Parsing of documents with multiple layers of entities result in a wrong
      DOM-tree. E.g. when parsing the following "MyDoc.xml" and its dependent
      documents with XERCES 2.2.0

      MyDoc.xml:
      ----------
      <?xml version="1.0" standalone="yes"?>
      <!DOCTYPE mydoc [
      <!ELEMENT mydoc (elem1, elem2)>
      <!ELEMENT elem1 (onlyonce)>
      <!ELEMENT elem2 (onlyonce)>
      <!ELEMENT onlyonce EMPTY>
      <!ENTITY Elem1 SYSTEM "Elem1.xml" >
      <!ENTITY Elem2 SYSTEM "Elem2.xml" >
      <!ENTITY OnlyOnce SYSTEM "OnlyOnce.xml" >
      ]>
      <mydoc>
      &Elem1;
      &Elem2;
      </mydoc>

      Elem1.xml:
      ----------
      <elem1>
      &OnlyOnce;
      </elem1>

      Elem2.xml:
      ----------
      <elem2>
      &OnlyOnce;
      </elem2>

      OnlyOnce.xml:
      -------------
      <onlyonce/>

      the resulting DOM-tree will look like:

      [...]
      <mydoc>
      <elem1>
      <onlyonce/>
      </elem1>
      <elem2>
      <onlyonce/>
      <onlyonce/>
      </elem2>
      </mydoc>

      In <elem2> the element <onlyonce> appears twice while it should be there
      only once. An <elem3> would appear 3 times and so on ....

      I looked up the XML-specifications of the W3C and could not find a hint
      that multiple layers of entities are forbidden by the language.
      Additionally Xerces-C 1.6.0 parsed the document correctly. So I consider
      this to be a bug of the new parser.

      Cheers

      Stefan

      Attachments

        Activity

          People

            Unassigned Unassigned
            stefan.roiser@cern.ch Stefan Roiser
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: