DO NOT REPLY [Bug 41741] New: - Namespace declarations kill XSLT processing.
| Newsgroups | gmane.text.xml.commons.devel |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
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=41741>.
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=41741
Summary: Namespace declarations kill XSLT processing.
Product: XmlCommons
Version: 1.x
Platform: All
OS/Version: other
Status: NEW
Severity: normal
Priority: P2
Component: JAXP
AssignedTo: [email protected]
ReportedBy: [email protected]
I am having a problem with the xalan-2.7.0 library.
Specifically it seems that adding namespaces to the input document prevents the
xalan xslt processor
from being able to process the file.
Take the following XSLT file:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="document">
<GotDocument>
<xsl:apply-templates/>
</GotDocument>
</xsl:template>
<xsl:template match="component">
<GotComponent>
<xsl:apply-templates/>
</GotComponent>
</xsl:template>
<xsl:template match="structuredBody">
<GotStructuredBody>
<xsl:apply-templates/>
</GotStructuredBody>
</xsl:template>
<xsl:template match="section">
<GotSection>
<xsl:apply-templates/>
</GotSection>
</xsl:template>
<xsl:template match="*">
</xsl:template>
</xsl:stylesheet>
And apply it to the following:
<?xml version="1.0" encoding="UTF-8"?>
<document xmlns:xl="http://www.w3.org/1999/xlink" xmlns="urn:PFE-FOO">
<component>
<structuredBody>
<component componentType="Numbered">
<section/>
</component>
<component componentType="Numbered">
<section/>
</component>
</structuredBody>
</component>
</document>
I get the following output:
<?xml version="1.0" encoding="UTF-8"?>
If however you remove the {xmlns="urn:PFE-FOO"} from the document tag, and run
the transform again,
then I get what I would expect:
<?xml version="1.0" encoding="UTF-8"?><GotDocument>
<GotComponent>
<GotStructuredBody>
<GotComponent>
<GotSection/>
</GotComponent>
<GotComponent>
<GotSection/>
</GotComponent>
</GotStructuredBody>
</GotComponent>
</GotDocument>
Any thoughts on how to make the xalan processor not choke when it gets that
namespace in the input
file?
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.