Details
-
Bug
-
Status: Open
-
Trivial
-
Resolution: Unresolved
-
None
-
None
-
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>