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 ?

My xalan version:
$ xalan -v

Xalan version 1.10.0
Xerces version 2.7.0

Reply via email to