-
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.
-
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.