on 07-05-2012 1:47 PM
Hi Experts,
I need to add ns0:namespace in the root element.
I am using a XSLT mapping for that.It is given below:
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="/">
<ABS
xmlns="namespace name"><xsl:copy-of select="." />
</ABC>
</xsl:template>
</xsl:stylesheet>
but the output I am getting is as below:
<?xml version="1.0" encoding="UTF-8"?>
<ABC xmlns="namespace name">
<ABC NumPrograms="">
<Program XMLProgramNum="">
<ProgramID/>
<FiscalYear/>
<SAPCountryCode/>
<CustNum/>
<BudgetCode/>
<SpecializedBusinessUnit/>
<FundedBy/>
<OffInvoice/>
<TotalBudget/>
<Exposure/>
</Program>
</ABC>
</ABC>
In the output I need it as below:
<?xml version="1.0" encoding="UTF-8"?>
<ABC NumPrograms="" xmlns="namespace name">
<Program XMLProgramNum="">
<ProgramID/>
<FiscalYear/>
<SAPCountryCode/>
<CustNum/>
<BudgetCode/>
<SpecializedBusinessUnit/>
<FundedBy/>
<OffInvoice/>
<TotalBudget/>
<Exposure/>
</Program>
</ABC>
In the target structure field ABC is comming twice..please note the diffence between the two structure.
Please resolve.
Regards
Joy
Hi Joy,
Use the followint XSLT (I have bolded my modifications):
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="ABC">
<ABC NumPrograms="" xmlns="namespace name">
<xsl:copy-of select="." />
</ABC>
</xsl:template>
</xsl:stylesheet>
Regards,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.