Say I have this given XML file:
<root>
<node>x</node>
<node>y</node>
<node>a</node>
</root>
And I want the following to be displayed:
ayx
Using something similar to:
<xsl:template match="/">
<xsl:apply-templates select="root/node"/>
</xsl:template>
<xsl:template match="node">
<xsl:value-of select="."/>
</xsl:template>
Easy!
<xsl:template match="/">
<xsl:apply-templates select="root/node">
<xsl:sort select="position()" data-type="number" order="descending"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="node">
<xsl:value-of select="."/>
</xsl:template>
You can do this, using xsl:sort. It is important to set the data-type="number" because else, the position will be sorted as a string, end therefor, the 10th node would ge considered before the 2nd one.
<xsl:template match="/">
<xsl:apply-templates select="root/node">
<xsl:sort
select="position()"
order="descending"
data-type="number"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="node">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates select="root/node[3]"/>
<xsl:apply-templates select="root/node[2]"/>
<xsl:apply-templates select="root/node[1]"/>
</xsl:template>
<xsl:template match="node">
<xsl:value-of select="."/>
</xsl:template>
Related
I doing an XSLT transformation.
input message:
<Accounts operation="query">
<Account operation="query">
<Home_spcPage>google.com</Home_spcPage>
<Id>1-NP8S</Id>
</Account>
</Accounts>
which should get transformed to :
<ipString>
<![CDATA[<Accounts operation="update" boNameVar="Account" bcNameVar="Account">
<Account operation="update">
<Home_spcPage>google.com</Home_spcPage>
<Id>1-NP8S</Id>
</Account>
</Accounts>]]>
</ipString>
I am trying with the below XSLT.
<xsl:stylesheet xmlns:crma="www.c123.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output indent="yes" method="xml"/>
<xsl:variable name="messageBlock">
<xsl:call-template name="main"/>
</xsl:variable>
<xsl:template match="/" name="main">
<xsl:apply-templates select="#*|node()"/>
</xsl:template>
<xsl:template match="#*|node()">
<xsl:variable name="level" select="count(ancestor::node())"/>
<xsl:copy>
<xsl:choose>
<xsl:when test="$level=2">
<xsl:attribute name="operation">
<xsl:value-of select="'update'"/>
</xsl:attribute>
<xsl:variable name="currNodeVar" select="name()"/>
<xsl:if test="$currNodeVar='Account'">
<xsl:attribute name="boNameVar">Account</xsl:attribute>
<xsl:attribute name="bcNameVar">Account</xsl:attribute>
</xsl:if>
<xsl:if test="$currNodeVar='Contact'">
<xsl:attribute name="boNameVar">Contact</xsl:attribute>
<xsl:attribute name="bcNameVar">Contact</xsl:attribute>
</xsl:if>
</xsl:when>
<xsl:when test="$level=4">
<xsl:attribute name="operation">
<xsl:value-of select="'update'"/>
</xsl:attribute>
<xsl:variable name="currBCNameVar" select="name()"/>
<xsl:variable name="parBCNameVar" select="name(../..)"/>
</xsl:when>
</xsl:choose>
</xsl:copy>
</xsl:template>
<xsl:template match="/">
<xsl:copy-of select="$messageBlock"/>
</xsl:template>
<xsl:template match="/">
<xsl:element name="ipString">
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
<xsl:copy-of select="$messageBlock"/>
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
but not getting the desired results . It seems like the XSLT is not considering the entire XML.
Any help is appreciated .
Thanks,
Naveen
When I execute the following xsl I get a truncated tag pair instead of the complete tag(see the very end of the question).
Original code:
<xsl:template match="node()\#*">
<xsl:copy>
<xsl:apply-templates select="node()\#*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="CONFIG">
<xsl:choose>
<xsl:when test=" ../ID/.='2'">
<xsl:copy>
<xsl:copy-of select="#*"/>
<xsl:text>STANDARD</xsl:text>
</xsl:copy>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="NAME">
<xsl:choose>
<xsl:when test=" ../ID/.='2'">
<xsl:copy>
<xsl:copy-of select="#*"/>
<xsl:text>DEVELOPMENT</xsl:text>
</xsl:copy>
</xsl:when>
</xsl:choose>
</xsl:template>
Modified code:
<xsl:template match="node()\#*">
<xsl:copy>
<xsl:apply-templates select="node()\#*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="CONFIG">
<xsl:choose>
<xsl:when test=" ../ID/.='2'">
<xsl:copy>
<xsl:copy-of select="#*"/>
<xsl:text>STD</xsl:text>
</xsl:copy>
<xsl:attribute name="KEY">
<xsl:value-of select='0'/>
<xsl:attribute>
<xsl:attribute name="NAME">
<xsl:value-of select="'DEVELOPMENT'"/>
<xsl:attribute>
</xsl:when>
</xsl:choose>
</xsl:template>
So the idea is instead of just setting CONFIG to "STANDARD", I'm also trying to set KEY.
And instead of processing the same "query" twice, I moved the setting of NAME up.
KEY is set correctly; but I get the truncated
<NAME>
instead of
<NAME>DEVELOPMENT</NAME>
I'm obviously not an XML guy, just doing some maintenance. Any leads or advice are appreciated.
You can't create attributes after an element's content has been output.
Move <xsl:attribute> above <xsl:text>.
<xsl:template match="node()|#*">
<xsl:copy>
<xsl:apply-templates select="node()|#*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="CONFIG[../ID = '2']">
<xsl:copy>
<xsl:apply-templates select="#*" />
<xsl:attribute name="KEY">0<xsl:attribute>
<xsl:attribute name="NAME">DEVELOPMENT<xsl:attribute>
<xsl:text>STD</xsl:text>
</xsl:copy>
</xsl:template>
I have two different transformation.After first transformation get over second need to be applied but not able to do.I have referred other stackoverflow post but its not working for me.
Sample Input:
<Para>1<AAA>2<BBB>3</BBB>4</AAA>5</Para>
Requirement is like BBB may available outside of AAA as well.We need to remove all AAA and put the value in comma separated format.
Expected output after First:
<Para>12<BBB>3</BBB>45</Para>
Expected output on the Second:
<Para>12,3,45</Para>
First:
Here i am just removing tag AAA from the content.And retriving its content and child.
<xsl:template match="#*|node()">
<xsl:copy>
<xsl:apply-templates select="#*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match ="*/AAA">
<xsl:apply-templates/>
</xsl:template>
Second:
Here I am just appending comma between the node element by removing all the tags inside para and retrieving its content.
<xsl:param name="Para"></xsl:param>
<xsl:template match="Para">
<xsl:copy>
<xsl:variable name="BBB-element-exists">
<xsl:for-each select="node()[self::BBB ][normalize-space(.)!='']">
<xsl:if test="(self::Change and (child::BBB)) or (self::BBB)">
<xsl:value-of select="'BBBexists'"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:if test="$BBB-element-exists = 'BBBexists'">
<xsl:for-each select=".//text()">
<xsl:if test="position() >1 and not(parent::Change) ">
<xsl:value-of select="','" />
</xsl:if>
<xsl:value-of select="normalize-space()" />
</xsl:for-each>
</xsl:if>
<xsl:if test="$BBB-element-exists != 'BBBexists'">
<xsl:for-each select=".//text()">
<xsl:value-of select="normalize-space()" />
</xsl:for-each>
</xsl:if>
</xsl:copy>
</xsl:template>
<xsl:template match="#*|node()">
<xsl:copy>
<xsl:apply-templates select="#*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
You will need to use at least one mode to separate processing of the second step from the first:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="#*|node()" mode="#all">
<xsl:copy>
<xsl:apply-templates select="#*|node()" mode="#current"/>
</xsl:copy>
</xsl:template>
<xsl:template match="*/AAA">
<xsl:apply-templates/>
</xsl:template>
<xsl:variable name="first-pass">
<xsl:apply-templates select="node()"/>
</xsl:variable>
<xsl:template match="/">
<xsl:apply-templates select="$first-pass/node()" mode="step2"/>
</xsl:template>
<xsl:template match="Para" mode="step2">
<xsl:copy>
<xsl:variable name="BBB-element-exists">
<xsl:for-each select="node()[self::BBB ][normalize-space(.)!='']">
<xsl:if test="(self::Change and (child::BBB)) or (self::BBB)">
<xsl:value-of select="'BBBexists'"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:if test="$BBB-element-exists = 'BBBexists'">
<xsl:for-each select=".//text()">
<xsl:if test="position() >1 and not(parent::Change) ">
<xsl:value-of select="','" />
</xsl:if>
<xsl:value-of select="normalize-space()" />
</xsl:for-each>
</xsl:if>
<xsl:if test="$BBB-element-exists != 'BBBexists'">
<xsl:for-each select=".//text()">
<xsl:value-of select="normalize-space()" />
</xsl:for-each>
</xsl:if>
</xsl:copy>
</xsl:template>
</xsl:transform>
In an XSL transformation, there are two things I have not been able to figure out.
In the source XML
<Network>
<Hosts>
<Host modelId="1" name="H1">
<LinPorts>
<LinPort name="Port3" speed="100" parent="H1"/>
</LinPorts>
<CanPorts/>
<EthernetPorts>
<EthernetPort name="Port1" speed="100" parent="H1"/>
<EthernetPort name="Port2" speed="100" parent="H1"/>
</EthernetPorts>
</Host>
<Host modelId="1" name="H2">
<CanPorts>
<CanPort name="Port2" speed="100" parent="H2"/>
</CanPorts>
<EthernetPorts>
<EthernetPort name="Port1" speed="100" parent="H3"/>
</EthernetPorts>
</Host>
<Host modelId="1" name="lin">
<LinPorts>
<LinPort name="Port1" speed="10" parent="lin"/>
<LinPort name="Port2" speed="100" parent="H2"/>
<LinPort name="Port3" speed="100" parent="lin"/>
</LinPorts>
</Host>
</Hosts>
<DataFrames>
<DataFrame bitSize="21" name="greasd" offset="0.021" period="0.021" prio="0">
<Path name="greasd-S5" parent="greasd">
<Node name="H1" sequenceNumber="1" parent="greasd-S5"/>
<Node name="S5" sequenceNumber="2" parent="greasd-S5"/>
</Path>
</DataFrame>
<DataFrame bitSize="23" name="hytdsg" offset="0.423" period="0.423" prio="0">
<Path name="hytdsg-H1" parent="hytdsg">
<Node name="H2" sequenceNumber="1" parent="hytdsg-H1"/>
<Node name="S5" sequenceNumber="2" parent="hytdsg-H1"/>
<Node name="H1" sequenceNumber="3" parent="hytdsg-H1"/>
</Path>
</DataFrame>
</DataFrames>
</Network>
some child nodes have been incorrectly placed. I am using the attribute #parent to place them correctly. This works well using the XSLT below.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<!-- Copy all nodes (that do not get a better match) as they are -->
<xsl:template match="#*|node()">
<xsl:copy>
<xsl:apply-templates select="#*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="Host">
<xsl:variable name="hostname" select="#name"/>
<xsl:copy>
<xsl:apply-templates select="#*"/>
<LinPorts>
<xsl:apply-templates select="//LinPorts/LinPort[#parent=$hostname]">
<xsl:sort select="#name" data-type="text" />
</xsl:apply-templates>
</LinPorts>
<CanPorts>
<xsl:apply-templates select="//CanPorts/CanPort[#parent=$hostname]">
<xsl:sort select="#name" data-type="text" />
</xsl:apply-templates>
</CanPorts>
<EthernetPorts>
<xsl:apply-templates
select="//EthernetPorts/EthernetPort[#parent=$hostname]">
<xsl:sort select="#name" data-type="text" />
</xsl:apply-templates>
</EthernetPorts>
</xsl:copy>
</xsl:template>
<xsl:template match="DataFrame">
<xsl:variable name="framename" select="#name"/>
<xsl:copy>
<xsl:apply-templates select="#*"/>
<xsl:apply-templates select="//Path[#parent=$framename]">
<xsl:sort select="#name" data-type="text" />
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="Path">
<xsl:variable name="pathname" select="#name"/>
<xsl:copy>
<xsl:apply-templates select="#*"/>
<xsl:apply-templates select="//Node[#parent=$pathname]">
<xsl:sort select="#sequenceNumber" data-type="text" />
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<!-- Do not save attributes parent and ID for child elements -->
<xsl:template match="CanPort|LinPort|EthernetPort|Node">
<xsl:copy>
<xsl:apply-templates select="#*[not(name()='parent') and not(name()='id')]">
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
I also create elements that are empty (CanPorts, LinPorts, EthernetPorts). How do I get rid of these?
I want to get rid of the #parent attribute. I have managed to do so for all elements except Path. How do I get rid of Path.parent?
For point 1, you can use an xsl:if to check the count of LinPort, CanPort, and EthernetPort before creating LinPorts, CanPorts, and EthernetPorts elements
And for 2, add another template that matches #parent and does nothing:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="#*|node()">
<xsl:copy>
<xsl:apply-templates select="#*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="Host">
<xsl:variable name="hostname" select="#name"/>
<xsl:copy>
<xsl:apply-templates select="#*"/>
<xsl:if test="count(//LinPorts/LinPort[#parent=$hostname]) != 0">
<LinPorts>
<xsl:apply-templates select="//LinPorts/LinPort[#parent=$hostname]">
<xsl:sort select="#name" data-type="text" />
</xsl:apply-templates>
</LinPorts>
</xsl:if>
<xsl:if test="count(//CanPorts/CanPort[#parent=$hostname]) != 0">
<CanPorts>
<xsl:apply-templates select="//CanPorts/CanPort[#parent=$hostname]">
<xsl:sort select="#name" data-type="text" />
</xsl:apply-templates>
</CanPorts>
</xsl:if>
<xsl:if test="count(//EthernetPorts/EthernetPort[#parent=$hostname]) != 0">
<EthernetPorts>
<xsl:apply-templates
select="//EthernetPorts/EthernetPort[#parent=$hostname]">
<xsl:sort select="#name" data-type="text" />
</xsl:apply-templates>
</EthernetPorts>
</xsl:if>
</xsl:copy>
</xsl:template>
<xsl:template match="DataFrame">
<xsl:variable name="framename" select="#name"/>
<xsl:copy>
<xsl:apply-templates select="#*"/>
<xsl:apply-templates select="//Path[#parent=$framename]">
<xsl:sort select="#name" data-type="text" />
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="Path">
<xsl:variable name="pathname" select="#name"/>
<xsl:copy>
<xsl:apply-templates select="#*"/>
<xsl:apply-templates select="//Node[#parent=$pathname]">
<xsl:sort select="#sequenceNumber" data-type="text" />
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<!-- Do not save attributes parent and ID for child elements -->
<xsl:template match="CanPort|LinPort|EthernetPort|Node">
<xsl:copy>
<xsl:apply-templates select="#*">
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<!-- This template matches #parent and #id and does nothing -->
<xsl:template match="#parent | #id"/>
</xsl:stylesheet>
I am generating XML file from Database as below...
<?xml version = '1.0'?>
<T0019>
<IFTA_ACCOUNT>
<IFTA_CARRIER_ID_NUMBER>705</IFTA_CARRIER_ID_NUMBER>
<IFTA_LICENSE_NUMBER>631227666</IFTA_LICENSE_NUMBER>
<IFTA_BASE_COUNTRY>US</IFTA_BASE_COUNTRY>
<IFTA_BASE_STATE>AL</IFTA_BASE_STATE>
<IFTA_STATUS_CODE>0 </IFTA_STATUS_CODE>
<IFTA_STATUS_DATE>2009-01-01</IFTA_STATUS_DATE>
<IFTA_ISSUE_DATE>2009-01-01</IFTA_ISSUE_DATE>
<IFTA_EXPIRE_DATE>2009-12-01</IFTA_EXPIRE_DATE>
<IFTA_UPDATE_DATE>2008-12-30</IFTA_UPDATE_DATE>
<NAME_TYPE>LG</NAME_TYPE>
<NAME>K D L TRUCKING INC</NAME>
<ADDRESS_TYPE>PH</ADDRESS_TYPE>
<STREET_LINE_1>200 MARTIN LANE</STREET_LINE_1>
<CITY>OHATCHEE</CITY>
<STATE>AL</STATE>
<ZIP_CODE>36271</ZIP_CODE>
<COUNTY>CALHOUN COUNTY</COUNTY>
<COUNTRY>US</COUNTRY>
</IFTA_ACCOUNT>
<IFTA_ACCOUNT>
<IFTA_CARRIER_ID_NUMBER>705</IFTA_CARRIER_ID_NUMBER>
<IFTA_LICENSE_NUMBER>631227666</IFTA_LICENSE_NUMBER>
<IFTA_BASE_COUNTRY>US</IFTA_BASE_COUNTRY>
<IFTA_BASE_STATE>AL</IFTA_BASE_STATE>
<IFTA_STATUS_CODE>0 </IFTA_STATUS_CODE>
<IFTA_STATUS_DATE>2009-01-01</IFTA_STATUS_DATE>
<IFTA_ISSUE_DATE>2009-01-01</IFTA_ISSUE_DATE>
<IFTA_EXPIRE_DATE>2009-12-01</IFTA_EXPIRE_DATE>
<IFTA_UPDATE_DATE>2008-12-30</IFTA_UPDATE_DATE>
<NAME_TYPE>LG</NAME_TYPE>
<NAME>K D L TRUCKING INC</NAME>
<ADDRESS_TYPE>MA</ADDRESS_TYPE>
<STREET_LINE_1>200 MARTIN LANE</STREET_LINE_1>
<CITY>OHATCHEE</CITY>
<STATE>AL</STATE>
<ZIP_CODE>36271</ZIP_CODE>
<COUNTRY>US</COUNTRY>
</IFTA_ACCOUNT>
</T0019>
I have taken first two records from generated XSLT.
With the use of XSLT I have tried lot to group record on basis of
IFTA_LICENSE_NUMBER,IFTA_BASE_COUNTRY,IFTA_BASE_ST ATE,NAME_TYPE,ADDRESS_TYPE but i failed to generated XML like this..
<?xml version="1.0" encoding="UTF-8" ?>
<T0019>
<IFTA_ACCOUNT>
<IFTA_CARRIER_ID_NUMBER>705</IFTA_CARRIER_ID_NUMBER>
<IFTA_BASE_COUNTRY>US</IFTA_BASE_COUNTRY>
<IFTA_BASE_STATE>AL</IFTA_BASE_STATE>
<IFTA_LICENSE_NUMBER>631227666</IFTA_LICENSE_NUMBER>
<IFTA_STATUS_CODE>0</IFTA_STATUS_CODE>
<IFTA_STATUS_DATE>2009-01-01</IFTA_STATUS_DATE>
<IFTA_ISSUE_DATE>2009-01-01</IFTA_ISSUE_DATE>
<IFTA_EXPIRE_DATE>2009-12-01</IFTA_EXPIRE_DATE>
<IFTA_UPDATE_DATE>2008-12-30</IFTA_UPDATE_DATE>
<IFTA_NAME>
<NAME_TYPE>LG</NAME_TYPE>
<NAME>K D L TRUCKING INC</NAME>
<IFTA_ADDRESS>
<ADDRESS_TYPE>PH</ADDRESS_TYPE>
<STREET_LINE_1>200 MARTIN LANE</STREET_LINE_1>
<STREET_LINE_2 />
<CITY>OHATCHEE</CITY>
<STATE>AL</STATE>
<ZIP_CODE>36271</ZIP_CODE>
<COUNTY>CALHOUN COUNTY</COUNTY>
<COUNTRY>US</COUNTRY>
</IFTA_ADDRESS>
<IFTA_ADDRESS>
<ADDRESS_TYPE>MA</ADDRESS_TYPE>
<STREET_LINE_1>200 MARTIN LANE</STREET_LINE_1>
<STREET_LINE_2 />
<CITY>OHATCHEE</CITY>
<STATE>AL</STATE>
<ZIP_CODE>36271</ZIP_CODE>
<COUNTY />
<COUNTRY>US</COUNTRY>
</IFTA_ADDRESS>
</IFTA_NAME>
</IFTA_ACCOUNT>
</T0019>
Your example input records have two different ADDRESS_TYPE values, so if you were grouping by ADDRESS_TYPE, these two would be distinct. And since your output also shows the two distinct values, I assume that you don't really want ADDRESS_TYPE in your list of grouping keys. Is that the real problem?
The XSLT spec gives two strategies for composite keys. When I tried the 'concat' strategy with your data, and with your list of keys minus ADDRESS_TYPE, it grouped these two records together.
Thanks , I have applied following XSLT to solve this Problem.
<xsl:stylesheet
version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="T0019">
<xsl:copy>
<xsl:for-each-group select="IFTA_ACCOUNT" group-by="IFTA_LICENSE_NUMBER">
<xsl:for-each-group select="current-group()" group-by="IFTA_BASE_COUNTRY">
<xsl:for-each-group select="current-group()" group-by="IFTA_BASE_STATE">
<IFTA_ACCOUNT>
<xsl:apply-templates select="IFTA_CARRIER_ID_NUMBER|IFTA_BASE_COUNTRY|IFTA_BASE_STATE|IFTA_LICENSE_NUMBER|IFTA_STATUS_CODE|IFTA_STATUS_DATE|IFTA_ISSUE_DATE|IFTA_EXPIRE_DATE|IFTA_UPDATE_DATE"/>
<xsl:for-each-group select="current-group()" group-by="NAME_TYPE">
<IFTA_NAME>
<xsl:apply-templates select="NAME_TYPE|NAME"/>
<xsl:for-each select="current-group()">
<IFTA_ADDRESS>
<xsl:apply-templates select="ADDRESS_TYPE|STREET_LINE_1|STREET_LINE_2|CITY|STATE|ZIP_CODE|COUNTY|COUNTRY"/>
</IFTA_ADDRESS>
</xsl:for-each>
</IFTA_NAME>
</xsl:for-each-group>
</IFTA_ACCOUNT>
</xsl:for-each-group>
</xsl:for-each-group>
</xsl:for-each-group>
</xsl:copy>
</xsl:template>
<xsl:template match="IFTA_CARRIER_ID_NUMBER">
<IFTA_CARRIER_ID_NUMBER>
<xsl:value-of select="."/>
</IFTA_CARRIER_ID_NUMBER>
</xsl:template>
<xsl:template match="IFTA_LICENSE_NUMBER">
<IFTA_LICENSE_NUMBER>
<xsl:value-of select="."/>
</IFTA_LICENSE_NUMBER>
</xsl:template>
<xsl:template match="IFTA_BASE_COUNTRY">
<IFTA_BASE_COUNTRY>
<xsl:value-of select="."/>
</IFTA_BASE_COUNTRY>
</xsl:template>
<xsl:template match="IFTA_BASE_STATE">
<IFTA_BASE_STATE>
<xsl:value-of select="."/>
</IFTA_BASE_STATE>
</xsl:template>
<xsl:template match="IFTA_STATUS_CODE">
<IFTA_STATUS_CODE>
<xsl:value-of select="."/>
</IFTA_STATUS_CODE>
</xsl:template>
<xsl:template match="IFTA_STATUS_DATE">
<IFTA_STATUS_DATE>
<xsl:value-of select="."/>
</IFTA_STATUS_DATE>
</xsl:template>
<xsl:template match="IFTA_ISSUE_DATE">
<IFTA_ISSUE_DATE>
<xsl:value-of select="."/>
</IFTA_ISSUE_DATE>
</xsl:template>
<xsl:template match="IFTA_EXPIRE_DATE">
<IFTA_STATUS_DATE>
<xsl:value-of select="."/>
</IFTA_STATUS_DATE>
</xsl:template>
<xsl:template match="IFTA_UPDATE_DATE">
<IFTA_ISSUE_DATE>
<xsl:value-of select="."/>
</IFTA_ISSUE_DATE>
</xsl:template>
<xsl:template match="NAME_TYPE">
<NAME_TYPE>
<xsl:value-of select="."/>
</NAME_TYPE>
</xsl:template>
<xsl:template match="NAME">
<NAME_TYPE>
<xsl:value-of select="."/>
</NAME_TYPE>
</xsl:template>
<xsl:template match="ADDRESS_TYPE">
<ADDRESS_TYPE>
<xsl:value-of select="."/>
</ADDRESS_TYPE>
</xsl:template>
<xsl:template match="STREET_LINE_1">
<STREET_LINE_1>
<xsl:value-of select="."/>
</STREET_LINE_1>
</xsl:template>
<xsl:template match="STREET_LINE_2">
<STREET_LINE_2>
<xsl:value-of select="."/>
</STREET_LINE_2>
</xsl:template>
<xsl:template match="CITY">
<CITY>
<xsl:value-of select="."/>
</CITY>
</xsl:template>
<xsl:template match="STATE">
<STATE>
<xsl:value-of select="."/>
</STATE>
</xsl:template>
<xsl:template match="ZIP_CODE">
<ZIP_CODE>
<xsl:value-of select="."/>
</ZIP_CODE>
</xsl:template>
<xsl:template match="COUNTY">
<COUNTY>
<xsl:value-of select="."/>
</COUNTY>
</xsl:template>
<xsl:template match="COUNTRY">
<COUNTRY>
<xsl:value-of select="."/>
</COUNTRY>
</xsl:template>
</xsl:stylesheet>
Thanks to all for your wonderful help.