Advise how to swap node values for every occurrence?
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 2
- Joined: Tue Sep 02, 2008 5:31 am
Advise how to swap node values for every occurrence?
Can anyone recommend a way to swap two node values for every occurrence of STMTTRN?
For instance:
the nodes NAME and MEMO values flip, becoming
I wanted to avoid writing a Java app to do something fairly trivial. Is there a way to do this just within Oxygen?
For instance:
Code: Select all
<STMTTRN>
<TRNTYPE>DEBIT</TRNTYPE>
<DTPOSTED>123</DTPOSTED>
<DTUSER>456</DTUSER>
<TRNAMT>-30.00</TRNAMT>
<FITID>987654321</FITID>
<NAME>Value A</NAME>
<MEMO>Value B</MEMO>
</STMTTRN>
<STMTTRN>
<TRNTYPE>DEBIT</TRNTYPE>
<DTPOSTED>456</DTPOSTED>
<DTUSER>789</DTUSER>
<TRNAMT>-50.00</TRNAMT>
<FITID>1234567890</FITID>
<NAME>Value C</NAME>
<MEMO>Value D</MEMO>
</STMTTRN>
Code: Select all
<STMTTRN>
<TRNTYPE>DEBIT</TRNTYPE>
<DTPOSTED>123</DTPOSTED>
<DTUSER>456</DTUSER>
<TRNAMT>-30.00</TRNAMT>
<FITID>987654321</FITID>
<NAME>Value B</NAME>
<MEMO>Value A</MEMO>
</STMTTRN>
<STMTTRN>
<TRNTYPE>DEBIT</TRNTYPE>
<DTPOSTED>456</DTPOSTED>
<DTUSER>789</DTUSER>
<TRNAMT>-50.00</TRNAMT>
<FITID>1234567890</FITID>
<NAME>Value D</NAME>
<MEMO>Value C</MEMO>
</STMTTRN>
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Advise how to swap node values for every occurrence?
Post by sorin_ristache »
Hello,
I think it is easier with an XSLT stylesheet that transforms the first XML document to the second one. You can start from an identity transform (look for such a transform with Google) and add some XSLT templates to that until the stylesheet does your transformation. You apply the XSLT transform in Oxygen with a transformation scenario.
Regards,
Sorin
I think it is easier with an XSLT stylesheet that transforms the first XML document to the second one. You can start from an identity transform (look for such a transform with Google) and add some XSLT templates to that until the stylesheet does your transformation. You apply the XSLT transform in Oxygen with a transformation scenario.
Regards,
Sorin
-
- Posts: 2
- Joined: Tue Sep 02, 2008 5:31 am
Re: Advise how to swap node values for every occurrence?
Thanks, I'll look into it. My original thought was to use XSLT but then I figured since I'm really concerned with the xml data itself, not as a datasource, that might be the wrong route.sorin wrote:Hello,
I think it is easier with an XSLT stylesheet that transforms the first XML document to the second one. You can start from an identity transform (look for such a transform with Google) and add some XSLT templates to that until the stylesheet does your transformation. You apply the XSLT transform in Oxygen with a transformation scenario.
Regards,
Sorin
Return to “General XML Questions”
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