C
cching
Hi,
I'm trying to turn this:
<Component>
<Properties>
<Property Name="X" Value="200" />
<Property Name="Y" Value="200" />
<Property Name="Width" Value="100" />
<Property Name="Height" Value="100" />
... other properties ...
</Properties>
</Component>
into this:
<div style="position: absolute; left: 200px; top: 200px; height: 100px;
width: 100px;">Blah</div>
I know how to find the nodes individually, e.g.:
<xsl:template match="Properties/Property[@Name='X']">
X: <xsl:value-of select="@Value" /> <br />
</xsl:template>
<xsl:template match="Properties/Property[@Name='Y']">
<xsl:variable name="Y" select="@Value" />
Y: <xsl:value-of select="@Value" /> <br />
</xsl:template>
but how can I do it for all of them and feed them into the div
attributes? I'm sure I'm missing something very fundamental and am
going to have an aha! experience if someone can help me figure this
out. Thanks in advance!
Cheers,
Craig
I'm trying to turn this:
<Component>
<Properties>
<Property Name="X" Value="200" />
<Property Name="Y" Value="200" />
<Property Name="Width" Value="100" />
<Property Name="Height" Value="100" />
... other properties ...
</Properties>
</Component>
into this:
<div style="position: absolute; left: 200px; top: 200px; height: 100px;
width: 100px;">Blah</div>
I know how to find the nodes individually, e.g.:
<xsl:template match="Properties/Property[@Name='X']">
X: <xsl:value-of select="@Value" /> <br />
</xsl:template>
<xsl:template match="Properties/Property[@Name='Y']">
<xsl:variable name="Y" select="@Value" />
Y: <xsl:value-of select="@Value" /> <br />
</xsl:template>
but how can I do it for all of them and feed them into the div
attributes? I'm sure I'm missing something very fundamental and am
going to have an aha! experience if someone can help me figure this
out. Thanks in advance!
Cheers,
Craig