xsl-list
[Top] [All Lists]

xpath question please

2003-09-30 14:25:14

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}_{(_at_)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



<Prev in Thread] Current Thread [Next in Thread>