2014-02-11 63 views
0

設置我有一個問題想像我有以下XML:XSLT數組包含其他數組

<dsQueryResponse> 
    <Work_Description> 
     <Rows> 
     <Row SId="{6EB1996C-8629-4BF9-92CA-956551E8D10D}" Title="DemoV1" /> 
     <Row SId="{6819144E-A9B7-4611-A694-7D2EDBF910A7}" Title="Template 1" /> 
     <Row SId="{2E56B932-F197-4335-AE92-1B5BF23D3EA4}" Title="Template 2" /> 
     </Rows> 
    </Work_Description> 
    <Reports> 
     <Rows> 
     <Row SId="{6EB1996C-8629-4BF9-92CA-956551E8D10D}" Title="Reports" /> 
     <Row SId="{6EB1996C-8629-4BF9-92CA-956551E8D103}" Title="Reports 2" /> 
     <Row SId="{6EB1996C-8629-4BF9-92CA-956551E8D10S}" Title="Reports 3" /> 
     <Row SId="{6EB1996C-8629-4BF9-92CA-956551E8D10A}" Title="Reports 4" /> 
     </Rows> 
    </Reports> 
    </dsQueryResponse> 

,並在我的XSLT我有以下:

<xsl:variable name="AllProjects" select="/dsQueryResponse/Work_Description/Rows/Row"/> 
    <xsl:variable name="AllReports" select="/dsQueryResponse/Reports/Rows/Row"/> 

現在我有這2個數組怎麼能我得到另一個數組,過濾所有描述行,其中repots SId =工作SId。 它應該是這樣的:<xsl:variable="Filtered" select="AllProjects[@SId=$AllReports/@SId]" />

回答

1

我不知道我完全理解你的問題......但是,這是工作:

<xsl:variable name="Filtered" select="$AllProjects[@SId=$AllReports/@SId]" /> 
<xsl:copy-of select="$Filtered"/> 
+0

哦,是的,它的工作哈 – Alnedru

相關問題