Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1225

Feature to store entityreferences in attribute values when building a DOM

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.9.0
    • None
    • DOM (Level 3 Core)
    • None

    Description

      Using the parameter "http://apache.org/xml/features/dom/create-entity-ref-nodes" you can store the entity references which belong to element values. But entity references in attribute values are not stored in the DOM. This makes it impossible to serialize the DOM back to the original xml. Please supply a similar feature for entity references in attribute values as implemented for elements. Especially in the case where you are using the DOM for updating other values , you need this.
      Example:
      Parse this xml to a DOM
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE personnel SYSTEM "personal.dtd" [
      <!ENTITY name "Big">
      <!ENTITY one "1">
      ]>
      <personnel>
      <person id="Big.Boss" salary="&one;">
      <name><family>Boss</family> <given>&name;</given></name>
      <email>chief@...</email>
      </person>
      </personnel>

      In the DOM you will have a entity referece node for &name as child for <given>
      There will be no entity reference node for &one in salary
      After serializing back to xml you will get:
      <?xml version="1.0" ?>
      <!DOCTYPE personnel SYSTEM "personal.dtd" [<!ENTITY name 'Big'>
      <!ENTITY one '1'>
      ]>
      <personnel>
      <person id="Big.Boss" salary="1">
      <name>
      <family>Boss</family>
      <given>&name;</given>
      </name>
      <email>chief@...</email>
      </person>

      Implementing this feature will also need changes in the serializer, to get the stored entities out in the XML

      Attachments

        Activity

          People

            Unassigned Unassigned
            dick.deneer Dick Deneer
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: