hi all,
i do have an xsl where i call a javascript function inside :
and here is the script inside the xsl :
(code]
<xsl:stylesheet xmlns:xsl=" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="urn:user-namespace-here" version="1.0">
<msxsl:script language="javascript" implements-prefix="user">
<![CDATA[
function getName(node)
{
return node.item(0).nodeName;
}
]]>
</msxsl:script>
[/code]
here is my xml structure :
the problem is that my function returns me the name of the node (field) and in fact i'd like to get the value of the "name" attribute (example : end date).
i tryed to put
return node.attributes(0).getNamedItem("name"
but it doesn't work.
so can someone give me the correct syntax please ?
Best regards,
Elise, XML learning girl X-)
i do have an xsl where i call a javascript function inside :
Code:
<xsl:for-each select="./*[1]">
<tr bgcolor="6699cc">
<xsl:for-each select="./*">
<td>
<xsl:value-of select="user:getName(.)"/>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
(code]
<xsl:stylesheet xmlns:xsl=" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="urn:user-namespace-here" version="1.0">
<msxsl:script language="javascript" implements-prefix="user">
<![CDATA[
function getName(node)
{
return node.item(0).nodeName;
}
]]>
</msxsl:script>
[/code]
here is my xml structure :
Code:
<results>
<result>
<field name="Project Site">Paris</field>
<field name="end date">07/04/2001</field>
<field name="Project name">Microsoft Visio 10 VS Help </field>
<field name="Project Code">ITOSE01001</field>
<field name="Status">Go</field>
</result>
....
</results>
i tryed to put
return node.attributes(0).getNamedItem("name"
but it doesn't work.
so can someone give me the correct syntax please ?
Best regards,
Elise, XML learning girl X-)