replace xml values with switch values
Posted: Wed Jan 20, 2016 10:33 am
Fellow switchers,
i use switch with xslt to create jobtickets from given XML files. now i want to modify data in that XML in switch then write a new XML with the new data (so replace values inside the XML by the new data from switch).
the xml file is quite big, so i don't feel like loading everything into private data or into a dataset made by switch via switchclient (for example) since then i have to create a new XSLT, which everytime i update the jobticket xslt i also have to update a second XSLT which uses the private data items.
for example:
in the XML there is:
<print duplex="yes" sides_printed="4/4" sides_printed_text="dubbelzijdig full colour" color_space="CMYK" collate="" facing_print="" page_order="" divider_sheet=""/>
if i want to replace the value duplex to "no" and the sides_printed to "4/0" but keep everything else like it is...
How would one go around that, is there a load xml replace value X by Y then export metadata... or anything like that ^^. if things ain't clear let me know. hmm... thinking about it, maybe XSLT 2.0?
thanks in advance.
Kevin
i use switch with xslt to create jobtickets from given XML files. now i want to modify data in that XML in switch then write a new XML with the new data (so replace values inside the XML by the new data from switch).
the xml file is quite big, so i don't feel like loading everything into private data or into a dataset made by switch via switchclient (for example) since then i have to create a new XSLT, which everytime i update the jobticket xslt i also have to update a second XSLT which uses the private data items.
for example:
in the XML there is:
<print duplex="yes" sides_printed="4/4" sides_printed_text="dubbelzijdig full colour" color_space="CMYK" collate="" facing_print="" page_order="" divider_sheet=""/>
if i want to replace the value duplex to "no" and the sides_printed to "4/0" but keep everything else like it is...
How would one go around that, is there a load xml replace value X by Y then export metadata... or anything like that ^^. if things ain't clear let me know. hmm... thinking about it, maybe XSLT 2.0?
thanks in advance.
Kevin