xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Csaba Koncz <csabako...@gmail.com>
Subject XPath expression in literal element namespace declaration
Date Mon, 13 May 2013 08:48:53 GMT
Hi all,

I need to generate a number of XML Schemas having some XML documents
as input (crazy, I know).

This is how I try to generate the root element of the schema:

    <xsl:param name="targetNS">http://a.com</xsl:param>

    <xsl:template match="/">
        <schema xmlns="http://www.w3.org/2001/XMLSchema"
                xmlns:tns="{$targetNS}"
                targetNamespace="{$targetNS}">
        </schema>
    </xsl:template>


Unfortunately the "{$targetNS}" expression in the xmln:tns attribute
is not evaluated, thus the created schema is unusable (I can not
reference types created for the target namespace).

The other way would be to declare the target namespace as the default
one in the schema, but that also fails.

Is there a restriction for using XPath expressions for namespace
declarations in the result document?

Is there a way to a achieve my goal to generate a namespace
declaration which is unknown at the time of writing the XSLT?

Thank you in advance,
Csaba

p.s. I am attaching the XSLT, a sample input and the generated output files.

Mime
View raw message