Combining results from multiple elements
Here should go questions about transforming XML with XSLT and FOP.
Combining results from multiple elements
Hi
I'm working on a solution for converting Office Open XML into tagged text. The XML contains paragraphs with a single style, and "runs" that can contain multiple style elements, such as Bold, Italic, Underline etc. If the run contains only a single style element, I can easily tag the wanted text. But the problem occurs whenever there are two or more style elements inside a run. How can I combine multiple styles into one in the result? I tried to use a variable to save the result and then use concat() to make a new string, but it seems that xslt variables cannot be updated after they are created.
Simplified XML:
Wanted output:
I'm grateful for any help!
Eivind
I'm working on a solution for converting Office Open XML into tagged text. The XML contains paragraphs with a single style, and "runs" that can contain multiple style elements, such as Bold, Italic, Underline etc. If the run contains only a single style element, I can easily tag the wanted text. But the problem occurs whenever there are two or more style elements inside a run. How can I combine multiple styles into one in the result? I tried to use a variable to save the result and then use concat() to make a new string, but it seems that xslt variables cannot be updated after they are created.
Simplified XML:
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:p>
<w:pPr>
<w:pStyle @w:val="Normal"/>
</w:pPr>
<w:r>
<w:rPr>
<w:cStyle @w:val="Hyperlink">
<w:b/>
</w:rPr>
<w:t>http://www.oxygenxml.com </w:t>
</w:r>
<w:r>
<w:rPr>
<w:b/>
<w:i/>
</w:rPr>
<w:t> - The best XML editor</w:t>
</w:r>
</w:p>
</w:document>
Wanted output:
Code: Select all
<pstyle:Normal><cStyle:HyperlinkBold>http://www.oxygenxml.com <cStyle:><cStyle:BoldItalic> - The best XML editor<cStyle:><pstyle:>
I'm grateful for any help!
Eivind
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