Uploaded image for project: 'Commons Jelly'
  1. Commons Jelly
  2. JELLY-217

org.apache.commons.jelly.tags.xml.ElementTag small bug in output wrapper

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • None
    • None
    • taglib.xml
    • None

    Description

      ElementTag has some small problems

      XMLOutput newOutput = new XMLOutput(output) {
      ...
      }

      Should include

      public void startPrefixMapping(String prefix, String uri)
      throws SAXException {
      initialize();
      super. startPrefixMapping (prefix, uri);
      }

      startPrefixMapping is called automatically in startElement, so whenever a child "script" wants to start outputing, it will call startPrefixMapping before startElement (if needed).
      To attain correctness, we should override startPrefixMapping as it's done in startElement.

      Related, we could do the same for

      public void comment(char ch[], int start, int length)
      throws SAXException {
      initialize();
      super. comment (ch, start, length);
      }

      to support

      <x:element name="abc">
      <x:comment>my comment</x:comment>
      </x:element>

      to generate
      <abc>
      <!-- my comment -->
      </abc>

      Attachments

        Activity

          People

            Unassigned Unassigned
            dquintela Diogo Bacelar Quintela
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: