on 11-07-2006 7:12 AM
Hi,
I have to code a XSLT mapping which converts the XML into a Fixed Length File Format. I am getting the output but it has some garbage values (Some extra spaces in front of first record and also extra blank lines before the first record)
I am pasting my xsl sheet :
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="yes" media-type="text/plain"/>
<xsl:template match="Employees">
<xsl:for-each select="Employee">
<xsl:value-of select="Name"/>
<xsl:value-of select="ID"/>
<xsl:value-of select="ADD"/>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
My input XML file is as follows:
<?xml version="1.0"?>
<p1:Test02 xmlns:p1="http://www.infosys.com/xi/training/hyd/66289">
<Employees>
<Employee>
<Name>Anurag</Name>
<ID>1121</ID>
<ADD>Hyderabad</ADD>
</Employee>
<Employee>
<Name>Divya</Name>
<ID>1122</ID>
<ADD>Hyderabad</ADD>
</Employee>
<Employee>
<Name>Rasmi</Name>
<ID>1123</ID>
<ADD>Bangalore</ADD>
</Employee>
</Employees>
</p1:Test02>
And the output i am receiving is as follows:
Anurag1121Hyderabad
Divya1122Hyderabad
Rasmi1123Bangalore
Please do help.....
hi,
>>>>
<xsl:output method="text" indent="yes" media-type="text/plain"/>
you allow the spaces by using indent="yes"
try with indent="no"
Regards,
michal
-
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.