Zealot wrote:
this is my test.xml

<?xml version="1.0"?>
<ns:root xmlns:ns="something"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="something test.xsd"
/>

and test.xsd

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema";
        targetNamespace="something"
        xmlns:ns="something">

        <complexType name="root" />

        <element name="root" type="ns:root" />
</schema>

test.xslt

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
        xmlns:ns="something">
        <xsl:output method="xml" />
        <xsl:template match="ns:root">
                <xsl:copy />
        </xsl:template>
</xsl:stylesheet>

use:

$ xalan -validate -xsl test.xslt -in test.xml

I got

<?xml version="1.0" encoding="UTF-8"?><root xmlns:ns="something" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>

but I expect root element with "ns" namespace prefix.
After deleting schema information in test.xml, it works well. I got :

<?xml version="1.0" encoding="UTF-8"?><ns:root xmlns:ns="something"/>

Is it a xalan bug ?

Definitely, although something very strange must be going on.

Can you please create a Jira issue and attach copies of the files?

    http://issues.apache.org/jira/browse/XALANC

I will try to take a look at this in the next couple of days.

Thanks!

Dave

Reply via email to