HTML in XML through XSL
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 2
- Joined: Wed May 23, 2007 7:58 am
HTML in XML through XSL
Hello everyone ! This is my first post and its very urgent for me
hope you guys will help me out here.
I have this xml in which I have html tags. I want to render the "<myhtml>" (as in example below) content through my XSL while retaining its formatting. At the moment my xsl (<xsl:value-of select="/top/myhtml"/>) is rendering <myhtml> node's inner content as it is without taking care of any formatting tags present inside the node.
e.g.
<top>
<myhtml>
Some <b>bold</b> content and some <i>italic</i> content
</myhtml>
</top>
Thanks in advance.

I have this xml in which I have html tags. I want to render the "<myhtml>" (as in example below) content through my XSL while retaining its formatting. At the moment my xsl (<xsl:value-of select="/top/myhtml"/>) is rendering <myhtml> node's inner content as it is without taking care of any formatting tags present inside the node.
e.g.
<top>
<myhtml>
Some <b>bold</b> content and some <i>italic</i> content
</myhtml>
</top>
Thanks in advance.
-
- Posts: 2
- Joined: Wed May 23, 2007 7:58 am
Thanks for your early response, George!george wrote:Use
<xsl:copy-of select="/top/myhtml/node()"/>
instead of value-of.
I did the change you said, but it truncated rest of the node's text as soon as it found the first HTML (<b>) tag.
And so the output visible in IE was only 'Some'
Code: Select all
Some
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Well, the above works, you can try it also in oXygen with a stylesheet like below:
Regards,
George
Code: Select all
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:g="http://www.oxygenxml.com/george">
<xsl:template match="/">
<xsl:copy-of select="/top/myhtml/node()"/>
</xsl:template>
</xsl:stylesheet>
George
George Cristian Bina
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service