xsl-list
[Top] [All Lists]

Xpath as variable, then processing it

2004-12-31 04:38:32
Hi all,

I have a little question :

I have a small XML Data containing in one of its field an Xpath (as
text) which should be used in an XSL-T for querying data in another XML
using this XPath. The following XSL handles it as a variable.

<Classes>
        <Class>
                <Architecture name="Application" abr="AA">
                        <xsl_File name="App_Apt_Apx_Applications" 
        
file="App_Apt_Apx_Applications.xsl" 
        
XPath="/Classes/Class/SADefinition[starts-with(@SAObjName,'app_') or
starts-with(@SAObjName,'apx_') or starts-with(@SAObjName,'apt_')]"/>
(...)

Then, the XSL file looks as follow :

<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
        <xsl:variable name="mainXML_node"
select="document('../XML/PM-EA-AA_IA_PA_TA.xml')"/>     (The main XML)
        <xsl:output method="html" version="1.0" encoding="UTF-16"
indent="yes"/>
        <xsl:template match="/">
                <xsl:result-document
href="../TCL/Temp/TCL_Data_Config.tmp">
                        <xsl:value-of disable-output-escaping="yes"
select="'{'"/>
                        <xsl:for-each-group
select="/Classes/Class/Architecture" group-by="@name">
                                <xsl:sort select="@name"/>
                                <xsl:value-of
disable-output-escaping="yes" select="concat('{',@name,' ')"/>
                                <xsl:for-each-group select="xsl_File"
group-by="@name">
                                        <xsl:sort select="@name"/>
                                        <xsl:variable name="path"
select="@XPath"/>
                                        <xsl:value-of
disable-output-escaping="yes" select="concat('{',@name,' ')"/>
                                        <xsl:for-each
select="$mainXML_node">                 (Here is the problem)
                                                <xsl:for-each-group
select="$path" group-by="@SAObjName">
                                                        <xsl:sort
select="@SAObjName"/>
(...)



I hope the upon the text is correctly indented by your mail browser.

Unfortunately, it won't work. Have anyone got an idea on how to solve my
problem?

Best regards

Lawrence



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>