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

Re: Creating custom IDs using Parent name tree

Subject: Re: Creating custom IDs using Parent name tree
From: "Wasiq Shaikh" <wasiq911@xxxxxxxxxxx>
Date: Tue, 24 Jul 2007 10:37:07 -0400
Re:  Creating custom IDs using Parent name tree
Thank you David for your suggestion, however, I should have been more clear on my example. The input file is actually an XSD, so ../@name wouldn't really work since the parent can be anything but <xsd:element>.

The other problem is that ../@name would give me only one parent name and not the ID of the parent. The ID of the parent doesn't exist and must be created (and stored ... somewhere?). Any element that needs to be processed needs to get the parent ID and concat its name to it.

The real problem is creating the ID, accessing that ID (which exists only in the resulting document), and appending the child elements name to it.

Input:

<xsd:element name="X">
     <xsd:complexType>
        <xsd:sequence>
              <xsd:element name="Y">
                 <xsd:complexType>
                    <xsd:sequence>
                       <xsd:element name="Z" type="ZType"/>
                    </xsd:sequence>
                 </xsd:complexType>
              </xsd:element>
              <xsd:element name="A" type="AType"/>
              <xsd:element name="Z">
                 <xsd:complexType>
                    <xsd:sequence>
                       <xsd:element name="Y">
                          <xsd:complexType>
                             <xsd:complexContent> ...

Should give:

<Elements>
 <element ID="X" name="X">
 <element ID="X.Y" name="Y">
 <element ID="X.Y.Z" name="Y">
 <element ID="X.A" name="A">
 <element ID="X.Z" name="Z">
 <element ID="X.Z.Y" name="Y">
</Elements>

So the element's ID depends on its parents ID which is only accessible in the resulting document. I hope this is more clear.

----Original Message Follows----

select="concat(PARENT_ID,'.',THIS_ELEMENTS_NAME)"/>
               ../@name            @name

David

_________________________________________________________________
Put Your Face In Your Space with Windows Live Spaces http://spaces.live.com/?mkt=en-ca


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.