troubleshooting Question

!CDATA <TR> tags are being converted to &gt;TR&lt; (XSLT)

Avatar of colly92002
colly92002Flag for United Kingdom of Great Britain and Northern Ireland asked on
Web Languages and StandardsXML
13 Comments1 Solution522 ViewsLast Modified:
Hello.

When my XML contains a node called "new_line", I would like to my XSLT to write out hte HTMl to close the table row and open a new one.

Since the parse does not like this (I know I am being naughty) I came up with the following:

            <xsl:when test = "name(.) = 'new_line'">
                <!--Need to break up the line -->

                  <![CDATA[
                  </TR>
                  <TR>
                  ]]>

            </xsl:when>
Unfortunately this converts the < and > into "&lt;" and "&gt;"

I tried wrapping it in <script> tags which does not convert it, but then the browser ignores the tags!

Any ideas?

Thanks.

(P.S. ideally (I think) I should develop some kind of xlst that will take take any XML convert this into further XML with additional sub-nodes <LINE1> <LINE2> etc, depending upto the the contents of the XML (i.e. where it finds "new_line" nodes).  My XSLT could then call templates for each subnode.  However I don't know how to do this but if you could point me in the direction of a tutorial I would be most grateful!).
ASKER CERTIFIED SOLUTION
Gertone (Geert Bormans)
Information Architect
Join our community to see this answer!
Unlock 1 Answer and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros