[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
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
|