|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am trying to use xsl:value-of to get the value of the attribute for an xml transformation. The xml code is
<ili:EXTENSION> <ili:NODE NAME="ACTOR" TYPE="STRING"/> </ili:EXTENSION> and I am trying to get the values for name and type. I have tried <xsl:value-of select="//CUSTOM_NODE/@NAME"/> as well as <xsl:value-of select="//ili:CUSTOM_NODE/@NAME"/> and could not get output for either. Any help would be greatly appreciated. Finally, I would like to use the for-each command. How is this used with attributes? |
|
#2
|
|||
|
|||
|
Here is an example of a quick and dirty way of
handling the "ili" namespace. There are more elegant ways. Refer to the namespace section of any good XML/XSL textbook for further information. Code:
<?xml version="1.0"?>
<ili:EXTENSION xmlns:ili="http://www.eaugallieboatworks.com/my.xsl">
<ili:NODE NAME="ACTOR" TYPE="STRING"/>
</ili:EXTENSION>
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ili="http://www.eaugallieboatworks.com/my.xsl">
<xsl:output method="html"/>
<xsl:template match="/">
<xsl:apply-templates select="/ili:EXTENSION/ili:NODE"/>
</xsl:template>
<xsl:template match="/ili:EXTENSION/ili:NODE">
<xsl:value-of select="@NAME"/>
</xsl:template>
</xsl:stylesheet>
|
|
#3
|
|||
|
|||
|
Is it possible to output the values into a table for the ili namespace? If yes, what is the code? Thank you so very much for your reply.
|
|
#4
|
|||
|
|||
|
Yes, it is possible. Provide a sample xml file and
details of the table type (row, colums, etc) and we can possibly help you. |
|
#5
|
|||
|
|||
|
I am trying to make a table with two columns, one for "name" and one for "type." The sample xml code is as follows:
<ili:EXTENSION> <ili:NODE NAME="ACTOR" TYPE="STRING"/> </ili:EXTENSION> <ili:EXTENSION> <ili:CUSTOM_NODE NAME="PERSON" TYPE="STRING"> </ili:EXTENSION> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Value-of for attributes |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|