I have some xml which looks like this:
<row>
<anode myattr1="value1" anotherAttr="notthis">
blah
</anode>
<anothernode myattr1="value1" myattr2="value2" anotherAttr="notthis">
blahBlah
</anothernode>
</row>
I want to turn into something like this:
<tr>
<td title="value1">
blah
</td>
<td title="value1\nvalue2">
blahBlah
</td>
</tr>
So I'm trying to use the "fn:starts-with" to select these attribute values, but is not quite working. This is what I have so far:
<xsl:for-each select="row">
<tr>
<xsl:for-each select="./*">
<xsl:variable name="title">
<xsl:for-each select="./@[fn:starts-with(name(),'myattr')]">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:variable>
<td title="$title"><xsl:value-of select="."/></td>
</xsl:for-each>
</tr>
</xsl:for-each>
But am getting an exception when I run this. Any help would be appreciated.
fn:prefix (which you don't need)?