-
July 9th, 2013, 07:04 PM
#1
XSLT question
<?xml version="1.0" encoding="UTF-8"?>
<OMDefault xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PrintDollarsAndCents>X</PrintDollarsAndCents>
<MailAddrLine1>Add1</MailAddrLine1>
<MailAddrLine2>Add2</MailAddrLine2>
</OMDefault>
I would like to have an XSLT to transform the XML to this
<?xml version="1.0" encoding="UTF-8"?>
<OMDefault xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PrintDollarsAndCents>Y</PrintDollarsAndCents>
<MailAddrLine1>Add1</MailAddrLine1>
<MailAddrLine2>Add2</MailAddrLine2>
</OMDefault>
Please notice the 'X' gets transformed to 'Y' if the attribute is PrintDollarsAndCents and its value is 'X' Could someone please help me with this? As I am very new to this XSLT thing.
Thank you in advance.
Last edited by trandd; July 9th, 2013 at 07:41 PM.
-
July 10th, 2013, 06:36 AM
#2
Re: XSLT question
there are no attributes in your xml, so I'm not sure what you're getting at.
other than that, it seems simple enough, make an XSLT to copy all nodes as is, and copy the tag you want by converting the contents in the way you want it.
From a tech pov, you don't even need a transform. open the xml, change the contents of that node, save the xml.
the point about transforms is that you "change" the structure of the xml which you aren't even doing here.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|