J
jorgen.wahlund
Hi
I have problems with transforming a xml document with Xalan and
javax.xml.Transformer.
Following xsl is used:
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:xalan="http://xml.apache.org/xslt"
xmlns:java="java"
xmlns:convert="com.foo.Class">
<xsl
utput method="xml"
encoding="UTF-8"
indent="yes"
xalan:indent-amount="2"/>
<and so on with specific transformation>
</xsl:stylesheet>
The xml parsed have the followin format:
<?xml version="1.0" encoding="utf-16"?>
<MessageHeader xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.foo2.com/XMLSchema/Envelope">
<Message xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
messageId="EMI20051026093900046"
xmlns="http://www.foo2.com/Schema.xsd">
<and so on with specific tags>
The problem I have is that the transformation, that earlier worked
fine, has stopped to work. The only differense is the last part of the
given xml. It has changed from:
xmlns=""
to
xmlns="http://www.foo2.com/Schema.xsd"
And the transformation stopps early without transforming the rest of
the document.
Questions:
What does the xmlns field do actually?
Can one override the xmlns field?
Any other solutions?
Remember that the xml given is from a another part and we cant control
the xml sent to us.
Thank you for your help
Jörgen
I have problems with transforming a xml document with Xalan and
javax.xml.Transformer.
Following xsl is used:
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:xalan="http://xml.apache.org/xslt"
xmlns:java="java"
xmlns:convert="com.foo.Class">
<xsl
encoding="UTF-8"
indent="yes"
xalan:indent-amount="2"/>
<and so on with specific transformation>
</xsl:stylesheet>
The xml parsed have the followin format:
<?xml version="1.0" encoding="utf-16"?>
<MessageHeader xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.foo2.com/XMLSchema/Envelope">
<Message xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
messageId="EMI20051026093900046"
xmlns="http://www.foo2.com/Schema.xsd">
<and so on with specific tags>
The problem I have is that the transformation, that earlier worked
fine, has stopped to work. The only differense is the last part of the
given xml. It has changed from:
xmlns=""
to
xmlns="http://www.foo2.com/Schema.xsd"
And the transformation stopps early without transforming the rest of
the document.
Questions:
What does the xmlns field do actually?
Can one override the xmlns field?
Any other solutions?
Remember that the xml given is from a another part and we cant control
the xml sent to us.
Thank you for your help
Jörgen