I have a requirement to run a transform on a xml file. it is going to be very basic, but having never done any xslt work before I’m a bit lost. i’ve had a very of a lot of SO Q&A’s but have not been able to work it out?
What I require is my xml file has a schema reference and I need to change it to a different schema reference.
<?xml version="1.0" encoding="UTF-8"?>
<Schedule xmlns="http://www.xxx.com/12022012/schedule/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xxx.com/12022012/schedule/v2 ../Schema/Schema_v2.xsd">
<Interface_Header>
</Interface_Header>
...
</Schedule>
I just want to alter the V2’s to V3’s, and keep the remainder of the file intact? It sounds very simple, but I cannot seem to figure this out? I tried a simple xslt here:-
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
but using this outputs all my values without any xml tags.
thanks in adv.
Use:
applied to provided XML produces