[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

ordering problem generating xslt from xsd

Subject: ordering problem generating xslt from xsd
From: bry@xxxxxxxxxx
Date: Fri, 20 Aug 2004 11:12:19 +0200
xsd ordering
I need an extra pair of eyes here, this doesn't seem to be right, given the
following xslt fragment using msxsl:

<xsl:template match="xsd:schema">
 <xsl:apply-templates select="xsd:element/xsd:annotation/xsd:documentation"/>
 <xsl:apply-templates>
              <xsl:with-param name="nmspc"                    
               select="@targetNamespace"/>
 </xsl:apply-templates>
</xsl:template>

<xsl:template match="xsd:annotation"/>
<xsl:template match="xsd:documentation">
  <oiodoc:documentation id="{ancestor::xsd:element/@name}">
  <xsl:apply-templates mode="copier"/>
  </oiodoc:documentation>
</xsl:template>
<xsl:template match="*" mode="copier">
 <xsl:copy><xsl:copy-of select="@*"/>
  <xsl:apply-templates mode="copier"/>
 </xsl:copy>
< /xsl:template>

<xsl:template match="xsd:element[parent::xsd:schema]">
 <xsl:param name="nmspc"/>
 <xsl:param name="nmspc-prefix"  
select="substring-before(name(msxml:node-set($usednamespaces)/namespaces/*[.=$nmspc]),':')"/>

  <txs:template match="{concat($nmspc-prefix,':',@name)}">
  </txs:template>
</xsl:template>

I get the following out of an xsd:

  <oiodoc:documentation id="BirthDate">Declares on which date an individuals
birth has taken place, and are consecutive used to declare an individuals age.
  </oiodoc:documentation> 
  <txs:template match="n16:BirthDate" /> 
  <oiodoc:documentation id="BuildingIdentifier">Unique number representing a
building/buildings which are part of a property. The number consists of three
numerics.
  </oiodoc:documentation> 
  <txs:template match="n16:BuildingIdentifier" /> 

when what I would expect is the following:

  <oiodoc:documentation id="BirthDate">Declares on which date an individuals
birth has taken place, and are consecutive used to declare an individuals age.
  </oiodoc:documentation>  
  <oiodoc:documentation id="BuildingIdentifier">Unique number representing a
building/buildings which are part of a property. The number consists of three
numerics.
  </oiodoc:documentation> 
  <txs:template match="n16:BuildingIdentifier" /> 
  <txs:template match="n16:BirthDate" />

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.