I have a big problem I'm hoping someone can help me with as I have exhausted all my brain cells over it! I have a code-driven HTML display application that uses (believe it or not) comment codes as its code. I now have to convert an XML document to this HTML document outputting these codes also. So I have the following: <!--code:code--><P>This is an HTML paragraph</P> I have tried everything from <xsl:text Disable...> to <xsl: text> to <![CDATA[ output. The disabling works, but it views it as a comment and removes it from the HTM doc on output. I have to be able to maintain its display as above. Please ANY suggestions?? Thanks so much in advance, Donna
"<" doesn't work and the comment string outputs the those word <xsl:comment>, etc. I have to have this translate exactly ... <!--code:code>. How about some kind of macro? Is there such a thing to call out when needed?
Leverager of our synergies
posted 17 years ago
Donna, how did you get <xsl:comment> in the output? Just curiuos. I am getting <!--code:code--> ... another variant: <xsl:copy-of> xml: <?xml version="1.0"?> <root> <!--code:code--> <P>This is an HTML paragraph</P> </root> xsl: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="P"> <xsl:copy-of select="."/> </xsl:template> <xsl:template match="comment()"> <xsl:copy-of select="."/> </xsl:template> </xsl:stylesheet> output: <!--code:code--> <P>This is an HTML paragraph</P>
Map, OH MY WORD! You won't believe what I was doing wrong! I forgot the <xsl: in front & back of the <xsl:comment> code so it was giving me the literal meaning. It isn't actually being used in the XML ... just in the my XSL conversion. I'm so sorry to have taken up your time with this. However, thanks so much for pointing out the obvious for me with your example or I would probably be bald by tomorrow! Thanks again, Donna