|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Generating schema target namespaces from XSLT
I have an XML format that we use to define our standard that is processed
with XSLT to generate a DTD or Schema based upon that format. Everything
has been ok until we added the target namespace to the schema. I can
parameterize the target attributes value, but I haven't found a way to
general the corresponding xmlns attribute to go with it without hardcoding
the value. Does anyone have a workaround?
Here is the relavent postion of the stylesheet: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsd = "http://www.w3.org/2001/XMLSchema"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:saxon="http://icl.com/saxon"
extension-element-prefixes="saxon"
xmlns="http://www.ACORD.org/standards/PC_Surety/ACORD1.1.1/xml/"
><xsl:param name="target" select="'http://www.ACORD.org/standards/PC_Surety/ACORD1.1.1/xml/'"/>
<xsd:schema> <xsl:attribute name="elementFormDefault">unqualified</xsl:attribute> <xsl:attribute name="attributeFormDefault">unqualified</xsl:attribute> <xsl:attribute name="targetNamespace"><xsl:value-of select="$target"/></xsl:attribute> <xsl:attribute name="version"><xsl:value-of select="ACORD-XML-DOC/@version"/></xsl:attribute> </xsl:template> </xsl:stylesheet> This produces the following Schema: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.ACORD.org/standards/PC_Surety/ACORD1.1.1/xml/" elementFormDefault="unqualified" attributeFormDefault="unqualified" targetNamespace="http://www.ACORD.org/standards/PC_Surety/ACORD1.2.0/xml/" version="1.2.0" > I can get the targetNamespace attribute set, but becasue the namespace has to be identified on the <stylesheet> attribute I can't use a parameter there to set this value to be the same - thus I have to hard code it. ..dan --------------------------------------------------------------------------- Danny Vint http://www.dvint.com XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








