Hi mobdev,
I think an XSP wont help you here.
Why don't you perform this process from a full XSL side ? If your xsl is
simple, maybe you could choose this solution.
sitemap :
<map:match pattern="myUrl">
<map:generate src="content.xml"/>
<map:transform type="xslt" src="myXSl.xsl"/>
<map:serialize type="xml"/>
</map:match>
myXSL.xsl
<xsl:template match="/">
<root>
<xsl:choose>
<xsl:when test="//tag1/text()='mode1'">
<xsl:apply-templates mode="mode1"/>
</xsl:when>
<xsl:when test="//tag1/text()='mode2'">
<xsl:apply-templates mode="mode2"/>
</xsl:when>
<xsl:otherwise>
<error message="tag1 value unknown"/>
</xsl:otherwise>
</xsl:choose>
</root>
</xsl:template>
<xsl:template match="tag2" mode="mode1">
...
</xsl:template>
<xsl:template match="tag2" mode="mode2">
...
</xsl:template>
<xsl:template match="@*|node()" mode="mode1">
<xsl:apply-templates select="@*|node()" mode="mode1"/>
</xsl:template>
<xsl:template match="@*|node()" mode="mode2">
<xsl:apply-templates select="@*|node()" mode="mode2"/>
</xsl:template>
It depends on the number of cases you have.
mobdev a écrit :
isit possible to parse xml files using XSP. i want to read some values
from an xml file and apply transform to that xml based on what i have
read. how can this be done through xsp.
eg i have an xml --- content.xml
<xml>
<tag1> content1 </tag1>
..............
................
..........
</xml>
i want to read the value for 'tag1' with my xsp and based on the
value of tag1, an appropriate xsl will be applied as transform for
content.xml. is it possible to do this using xsp?
--
Mathieu GARCIA
Systèmes d'Information
ANYWARE TECHNOLOGIES
tel : +33 (0)5 61 00 52 90
fax : +33 (0)5 61 00 51 46
www.anyware-tech.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]