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