Splitting elements with XSLT?
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 2
- Joined: Tue Jun 01, 2010 3:54 pm
Splitting elements with XSLT?
Hi!
Sitting with a document conversion/transformation where an element needs to split and I do not know how to handle it with XSL.
An example of input data:
An example of what I want to see in the output data:
The rule here is that only one graphic can exist in each container, so you want to match second graphic within a container and split the container.
What I like to do is match the second and put in this:
So I thought that a split-function, like for instance Arbortext Editor have, would solve the situation.
Any ideas someone?
Thanx!
Sitting with a document conversion/transformation where an element needs to split and I do not know how to handle it with XSL.
An example of input data:
Code: Select all
<document>
<container>
<p>TEXT HERE</p>
<graphic ref="test.eps"/>
<p>MORE TEXT</p>
<graphic ref="newtest.eps"/>
<p>EVEN MORE TEXT</p>
</container>
</document>
Code: Select all
<document>
<container>
<p>TEXT HERE</p>
<graphic ref="test.eps"/>
<p>MORE TEXT</p>
</container>
<container>
<graphic ref="newtest.eps"/>
<p>EVEN MORE TEXT</p>
</container>
</document>
What I like to do is match the second and put in this:
but that is not valid XML!</container>
<container>
So I thought that a split-function, like for instance Arbortext Editor have, would solve the situation.
Any ideas someone?
Thanx!
-
- Posts: 2
- Joined: Tue Jun 01, 2010 3:54 pm
Re: Splitting elements with XSLT?
Hi again,
Found a way myself.
I use the CDATA-functionality, then it works.
I do this:
Not nice, but works!
BGood everyone!
/B
Found a way myself.
I use the CDATA-functionality, then it works.
I do this:
Code: Select all
<xsl:text disable-output-escaping="yes"><![CDATA[</container><container>
]]></xsl:text>
BGood everyone!
/B
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