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

Schema Exploration...

Subject: Schema Exploration...
From: Mark Diggory <mdiggory@xxxxxxxxxxxxxxxxx>
Date: Thu, 18 Apr 2002 14:07:58 -0400
exploration and schema
I'm trying to select a schema element node relative to the current xs:element node I've referenced in a parameter ($schema_node). The problem is that there are several cases that need to be checked for:

xs:element/*[@name='test1a' or @ref='test1b']
xs:element/xs:complexType/xs:choice/*[@name='test2a' or @ref='test2b']
xs:element/xs:complexType/xs:sequence/*[@name='test3a' or @ref='test3b']

...
  <xs:element name="test1">
     <xs:element name="test1a"/>
     <xs:element ref="test1b"/>
  </xs:element>

  <xs:element name="test2">
     <xs:complexType>
         <xs:choice>
            <xs:element name="test2a"/>
            <xs:element ref="test2b"/>
            ...
         </xs:choice>
      </xs:complexType>
  </xs:element>

  <xs:element name="test3">
     <xs:complexType>
	<xs:sequence>
            <xs:element name="test3a"/>
            <xs:element ref="test3b"/>
             ...
         </xs:sequence>
      </xs:complexType>
  </xs:element>
...

I'm struggling to get an pattern that will match all these cases, currently I have one case matched and working:

<xsl:param name="node_name" select="name()"/>

<xsl:apply-templates select="
$schema_node/xs:element[@name=$node_name or @ref=$node_name]
"/>

I'm not sure how I would expand this case to include the other ones.

-Mark



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


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.