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

Interrogating attributes values to get text

Subject: Interrogating attributes values to get text
From: Charles Flanders <cflanders@xxxxxxxxxx>
Date: Thu, 19 Mar 2009 18:42:13 -0400
 Interrogating attributes values to get text
I could use help with problem that I just don't seem to have the programming chops to conquer. I don't have template for anyone to analyze, I can't seem to get to that state. I'm using XSL 1.0.

Here is my conundrum:

I have an element <HYPERTEXT>, that has an attribute called "linkend". The value of "linkend" corresponds to an ID attribute on an element further up the tree (preceding). This element is named <nameloc>. This element has a child, <nmlist>. My goal is to convert <HYPERTEXT> to <link> (easy enough). But my problem is I can't seem to write an expression (xsl:if? xsl:when?) to can go find the <nameloc> element that has the corresponding ID, then get the text of <nmlist> as the value of an "item" attribute on <link>.

The following are just snippets of XML. The entire tree structure should be irrelevant. Also, the <nameloc> and <nmlist> elements are eliminated in the results (not converted or output).

Current XML:

<document>
   <nameloc id="M05-08.-HT2">
       <nmlist nametype="element" dtdorlpd="REAR" docorsub="APPX-F"
       elemtype="ROW">item1</nmlist>
   </nameloc>


<STEP> <HYPERTEXT linkend="M05-08.-HT2">Service air cleaner assembly.</HYPERTEXT> </STEP> </document> The result I need to create is this:

<step>Service air cleaner assembly.<link item="item1"></step>

How do I write a test will get me text of <nmlist> based on the comparison of "linkend" and "id"?

Thanks.

C. Flanders

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.