Hi,
I am trying to create a xslt , But I am getting below result,
Means I am getting All SNames in <SNAME> and Codes in <code>.
see below the output.
Output :
<ShortName>DOCENGTEACLE</ShortName>
<Code>666777888999</Code>
But I want something like this
<SName>DOC</SName>
<Code>666</Code>
<SName>ENG</SName>
<Code>777</Code>
<SName>TEA</SName>
<Code>888</Code>
<SName>CLE</SName>
<Code>999</Code>
or something like this is also fine
<DOCTOR>
<SName>DOC</SName>
<Code>666</Code>
</DOCTOR>
<ENGINEER>
<SName>ENG</SName>
<Code>777</Code>
</ENGINEER>
<TEACHER>
<SName>TEA</SName>
<Code>888</Code>
</TEACHER>
<CLERK>
<SName>CLE</SName>
<Code>999</Code>
</CLERK>
I applied the below xslt in my original xslt.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xslutput method="xml" encoding="utf-8" omit-xml-declaration="no" indent="yes" />
<xsl:template match="/">
<xsl:element name="SName">
<xsl:apply-templates select="//@SName"/>
</xsl:element>
<xsl:element name="Code">
<xsl:apply-templates select="//@Code">
</xsl:apply-templates>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
My Actual XML File :
<Qxml>
<Qxml>
<Net>
<Property Name="DOCTOR" SName="DOC" LongDesc="YYY DOC" Code="666" STC="1"/>
<Property Name="ENGINEER" SName="ENG" LongDesc="XXX ENG" Code="777" STC="2"/>
<Property Name="TEACHER" SName="TEA" LongDesc="ZZZ TEA" Code="888" STC="3"/>
<Property Name="CLERK" SName="CLE" LongDesc="TTT CLE" Code="999" STC="4"/>
</Net>
</Qxml>
</Qxml>
Thanks
I am trying to create a xslt , But I am getting below result,
Means I am getting All SNames in <SNAME> and Codes in <code>.
see below the output.
Output :
<ShortName>DOCENGTEACLE</ShortName>
<Code>666777888999</Code>
But I want something like this
<SName>DOC</SName>
<Code>666</Code>
<SName>ENG</SName>
<Code>777</Code>
<SName>TEA</SName>
<Code>888</Code>
<SName>CLE</SName>
<Code>999</Code>
or something like this is also fine
<DOCTOR>
<SName>DOC</SName>
<Code>666</Code>
</DOCTOR>
<ENGINEER>
<SName>ENG</SName>
<Code>777</Code>
</ENGINEER>
<TEACHER>
<SName>TEA</SName>
<Code>888</Code>
</TEACHER>
<CLERK>
<SName>CLE</SName>
<Code>999</Code>
</CLERK>
I applied the below xslt in my original xslt.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xslutput method="xml" encoding="utf-8" omit-xml-declaration="no" indent="yes" />
<xsl:template match="/">
<xsl:element name="SName">
<xsl:apply-templates select="//@SName"/>
</xsl:element>
<xsl:element name="Code">
<xsl:apply-templates select="//@Code">
</xsl:apply-templates>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
My Actual XML File :
<Qxml>
<Qxml>
<Net>
<Property Name="DOCTOR" SName="DOC" LongDesc="YYY DOC" Code="666" STC="1"/>
<Property Name="ENGINEER" SName="ENG" LongDesc="XXX ENG" Code="777" STC="2"/>
<Property Name="TEACHER" SName="TEA" LongDesc="ZZZ TEA" Code="888" STC="3"/>
<Property Name="CLERK" SName="CLE" LongDesc="TTT CLE" Code="999" STC="4"/>
</Net>
</Qxml>
</Qxml>
Thanks