Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSL Newbie 1

Status
Not open for further replies.

danmat46

Programmer
Nov 13, 2007
23
GB
Morning all,
Just started out with XSL.
Now working on my first example I have the following XML structure

<topLevel>
<repeatLevel name="hello" type="hello">
<![CDATA[sometext in here]]>
</repeatLevel>
<repeatLevel name="hello2" type="hello2">
<![CDATA[more text in here]]>
</repeatLevel>
</topLevel>

Now developing the XSL is going fine, I have an html table with three columns and been able to output the name and type but I cannot get the CDATA's text in the third column.

Is this possible?

And no unfortunatly I cannot change the XML format to add the CDATA as an attribute.

Any help welcomed!

Thank you
 
ok the repeative element of the xml is represented in the XSL file like the below:

<tr>
<td><xsl:value-of select="@name"/></td>
<td><xsl:value-of select="@type"/></td>
<!--<td><xsl:value-of select="&lt;![CDATA["/></td>-->
</tr>
 
><!--<td><xsl:value-of select="&lt;![CDATA["/></td>-->
If you want to include the CDATA tag, you can do this.
[tt] <td><xsl:value-of select="concat('&lt;![CDATA[',.,']]&gt;')" /></td>[/tt]
Otherwise, you can do simply this.
[tt] <td><xsl:value-of select="." /></td>[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top