|
next
|
 Subject: Set the xmlns namespace depending on a condition. Author: manjunath Angadi Date: 03 Aug 2006 08:42 AM
|
Hi ivan,
I got the solution u sent and my problem got solved.Thank you very much for your guidance.
But one more problem raised.
that is,
Some unwanted values are getting printed at the beginning of the output.
for example,
the input xml is,
<?xml version="1.0" encoding="UTF-8"?>
<xml responsetype="ERROR-BRMS"
xmlns="http://www.atis.org/tML/UOM/ASR.UOM-ASR"
xmlns:tML="urn:int.itu/tML/tMLSchemaMetadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<validation>
<project>project name</project>
<exceptionlist>
<datetime>03:08:2006:06:01:PM</datetime>
<exception>
<field>parent/child/fieldname</field>
<code>001</code>
<message>errror in the field</message>
.............some xml elements.
</exception>
</exceptionlist>
</xml>
the xsl is,
After doing all the chenges above u suggested, i m just pasting the main template where i m calling the other templates.
<xsl:template match="/">
<xsl:choose>
<xsl:when test="$response = namespace-uri(*)">
<ASR_SERVICE_RESPONSE xmlns="http://www.atis.org/tML/UOM/ASR.UOM-ASR" responsetype="ERROR">
<xsl:apply-templates mode="response"/>
</ASR_SERVICE_RESPONSE>
</xsl:when>
<xsl:when test="$notify = namespace-uri(*)">
<DESIGN_NOTIFY xmlns="http://www.atis.org/tML/UOM/ASR.UOM-ASRNotify" responsetype="ERROR">
<xsl:apply-templates mode="notify"/>
</DESIGN_NOTIFY>
</xsl:when>
</xsl:choose>
</xsl:template>
the templates i m calling with mode="response" and "notify", starts with the match attribute,
<xsl:template match="/b:xml/b:validation/b:exceptionlist" mode="response">
.......executable statements...
but not printing the value of the project.........
</template>
here, though i am not selecting the value of project, i am getting the value "project name" displayed under the root element and then the way i want the output.
I am not getting why this unnecessary value get printed in the output.
when i click on that value,
the back-map-stack displays the message like this.
<xsl:template match="/"... in filename.xsl(line 0)
Please clarify how to remove the unwanted values from the output xml?
Please tell me.
Thanks,
Manjunath
|
|
|
|