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

Re: Schema Exploration...

Subject: Re: Schema Exploration...
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 19 Apr 2002 10:23:10 +0100
xs complextypes
Hi Mark,

> This seems the most effective solution and it worked:
>
> <xsl:variable name="my_snode" select="($parent_snode/xs:element | 
> $parent_snode/xs:complexType/xs:choice/xs:element | 
> $parent_snode/xs:complexType/xs:sequence/xs:element)[@name=$node_name or 
> @ref=$node_name]"/>
>
> I don't suspect that a xs:element can fall anywhere else in another
> xs:element. But if it does I can just add it to the select
> statement.

You can have nested declarations -- an xs:element holding an anonymous
xs:complexType that contains xs:elements.

You can also have xs:group definitions at the top level that hold
model groups.

And xs:complexTypes themselves can contain
xs:complexContent/xs:restriction or xs:complexContent/xs:extension
elements, which then hold the content models.

And the content model elements xs:choice/xs:sequence can be nested
inside each other. Plus there's xs:all.

If you're searching for element declarations or references in all
those places, and you're doing it multiple times, all in all it's a
lot easier to create a key:

<xsl:key name="elements" match="xs:element" use="(@name | @ref)" />

Then you can just do:

  key('elements', $node_name)

rather than constructing a massive path. It'll be quicker too.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.