Uploaded image for project: 'Axiom'
  1. Axiom
  2. AXIOM-435

Consistently implement support for entity references

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.2.13
    • 1.2.14
    • API
    • None

    Description

      Currently (unexpanded) entity references are represented as OMText instances with type=ENTITY_REFERENCE_NODE. This is a bad choice:

      • An entity reference doesn't necessarily represent character data: the expansion can e.g. produce elements. Representing it as an OMText is therefore conceptually wrong.
      • There is lots of code that checks for OMText and then uses OMText#getText() under the assumption that the return value represents character data. However, for an entity reference, getText() would return the entity name.

      It should also be noted that the test coverage for entity references is currently almost nonexistent. As a result, the code that handles entity references is inconsistent. E.g. OMStAXWrapper/SwitchingWrapper contains the following code:

      if ((currentEvent == START_ELEMENT)

      (currentEvent == END_ELEMENT)
      (currentEvent == ENTITY_REFERENCE)) { return ((OMElement) lastNode).getLocalName(); }

      else

      { throw new IllegalStateException(); }

      This is obviously incorrect.

      Attachments

        Activity

          People

            veithen Andreas Veithen
            veithen Andreas Veithen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: