[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: xpath question please
Of course, I hadn't tried {ancestor::Station/@name} which I just tried...ugh. Thanks anyway. Kathy -----Original Message----- From: Kathy Burke [mailto:Kathy_Burke@xxxxxxxxx] Sent: Tuesday, September 30, 2003 5:25 PM To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx' Subject: xpath question please Please don't yell at me. I've been trying to solve this all day, have reviewed xpath syntax, etc. Just can't get it right. I'm working on a stylesheet that creates html table rows etc. using AVTs to assign the form id's needed (see below). All was going fine until I went down to another level and now I can't get the higher level element attributes...just getting blanks. My xml source (typed carefully): <Assembly> <Station name="Station1"> <WI order="1" title="doc1"> <Board sn="111"/> <Board sn="112"/> <WI order="2" title="doc2"> <Boards> <Board sn="111"/> <Board sn="112"/> </Boards> </WI> <WI order="3" title="doc3"> <Boards> <Board sn="111"/> <Board sn="112"/> </Station> <Station name="Station2"> <WI order="1" title="doc7"> <Board sn="111"/> <Board sn="112"/> <WI order="2" title="doc2"> <Boards> <Board sn="111"/> <Board sn="112"/> </Boards> </WI> </Station> </Assembly> When I use this: <xsl:for-each select="./WI"> This works <tr id=Show_{../@name}_{@order} > -- gives me the correct @name of the <Station> and @order for the <WI> But when I get to this level: <xsl:for-each select="./WI/Boards/Board">, I still need the @name of Station and the @order of <WI> but can't get them. I hope this is clear enough. I'm afraid to tell you what I've tried because I ended up trying anything and even guessing. For example, shouldn't {../@order} at this level given me the order attribute for WI? Afraid I'm truly lost at this point. Simple though it should be. Thanks, Kat XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|