You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2004/06/06 17:07:03 UTC

DO NOT REPLY [Bug 29411] New: - XSLTC generates uneccessary preifix/URI mappings to serializer

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29411>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29411

XSLTC generates uneccessary preifix/URI mappings to serializer

           Summary: XSLTC generates uneccessary preifix/URI mappings to
                    serializer
           Product: XalanJ2
           Version: CurrentCVS
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xalan.xsltc
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: minchau@ca.ibm.com


The serializer presumes that a prefix mapping on a parent element automatically 
is inherited by a child element. It is redundant to keep telling the serializer 
about all namespace mappings at each element.  Consider this stylesheet:
...
<xsl:template match="/">
<elem0 xmlns:foo0="baseuri0">
<elem1 xmlns:foo1="baseuri1">
<elem2 xmlns:foo2="baseuri2">
</elem2>
</elem1>
</elem0>
</xsl:template>
...

The code generated by XSLTC for the translet looks like this:
-------------------------------------------
serializationhandler.startElement("elem0");
serializationhandler.namespaceAfterStartElement("foo0", "baseuri0");
serializationhandler.startElement("elem1");
serializationhandler.namespaceAfterStartElement("foo1", "baseuri1");
serializationhandler.namespaceAfterStartElement("foo0", "baseuri0");
serializationhandler.startElement("elem2");
serializationhandler.namespaceAfterStartElement("foo2", "baseuri2");
serializationhandler.namespaceAfterStartElement("foo1", "baseuri1");
serializationhandler.namespaceAfterStartElement("foo0", "baseuri0");
endElement(); // elem2
endElement(); // elem1
endElement(); // elem0
---------------------------------------------

There would be less code generated and it would run faster if the code 
generated were like this:
-------------------------------------------
serializationhandler.startElement("elem0");
serializationhandler.namespaceAfterStartElement("foo0", "baseuri0");
serializationhandler.startElement("elem1");
serializationhandler.namespaceAfterStartElement"foo1", "baseuri1");
serializationhandler.startElement("elem2");
serializationhandler.namespaceAfterStartElement("foo2", "baseuri2");
endElement(); // elem2
endElement(); // elem1
endElement(); // elem0
---------------------------------------------

These are internal calls between XSLTC and the serializer, not a public API, 
but these changes could be made to make things run faster.

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org