xsl-list
[Top] [All Lists]

Re: Close but a little off

2003-04-16 11:04:53

On Wednesday, April 16, 2003, at 01:25  PM, Karl J. Stubsjoen wrote:

Hello,
I'm close, but just a little off and am not sure how to refer to the parent
(think its considered parent) xpath.
I have the following template:

<xsl:template match="xml/rs:data/z:row">
<table border="1">
 <xsl:for-each select="//xml/s:Schema/s:ElementType/s:AttributeType">
    <tr>
     <td><xsl:value-of select="@name"/></td>
     <td><xsl:value-of select="/xml/rs:data/z:row/@name"/>&nbsp;</td>

Here @name is scoped INSIDE the xpath statement, you want it scoped OUTSIDE... so you'll have to use current() to do that. I think something like

/xml/rs:data/z:row/*[local-name() = current()/@name]

should work

simon

    </tr>
    </xsl:for-each>
</table>
</xsl:template>

In english, this translates to:
For each row loop throught the s:AttributeType node. This node contains the name of the attribute for the field, the size of the element, etc... I need
to return the name of the attribute and then use this name to match the
attribute in the original match "xml/rs:data/z:row".
I'm close... in my 2nd xsl:value-of, I'm not sure how to refer to the values from the original match and not values which are coming from the for-each
loop.
Hope that makes sense.
Thanks,
Karl


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



--
     anti-spam: do not post this address publicly
www.simonwoodside.com -- 99% Devil, 1% Angel


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



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