xsl-list
[Top] [All Lists]

RE: (No Subject) Nested for-each

2003-07-29 10:46:01
You need to appreciate the idea of "context" to understand where you are going 
wrong here. The outer for-each selects as the context node an element at the 
end of this XPath "Entity_Groups/Entity/EntityProps". While you are inside that 
loop, your inner for-each is looking for an element that matches this XPath 
"Entity_Groups/Entity/EntityProps/Entity_Groups/Entity/Attribute_Groups/Attribute/AttributeProps",
 in spite of what you hope and think it is selecting. I'll bet a Euro that you 
don't have single node in your XML document that matches that second XPath. Of 
course, without seeing your source document we can't tell for certain.

Please supply a minimal sample of your source XML so we can help further.
-- 
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     AROSO Jose Antonio <jose(_dot_)santos(_at_)enabler(_dot_)com>
Sent:     Tue, 29 Jul 2003 18:05:02 +0100
To:       "'xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com'" 
<xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject:  

Hi...

I want use a two loops for-each. The first for-each dont have problems. But
the second dont execute.
How can i use two loops to catch data from diferent nodes?


This code is my code. I dont know why this is dont run.

                                <xsl:for-each
select="Entity_Groups/Entity/EntityProps">
                                Tabela:
                                <xsl:value-of select="Name" /> 
                                <br/>
                                Comentarios:
                                <xsl:value-of select="comment" />
                                <p/>
                        
                        
                        <table border="3">
                        <xsl:for-each
select="Entity_Groups/Entity/Attribute_Groups/Attribute/AttributeProps">
                        
                        <tr>
                                <td style="text-align:center">NOME</td> 
                                <td style="text-align:center">TIPO</td> 
                                <td
style="text-align:center">COMENTARIOS</td>              
                        </tr>
                        <tr>
                                <td>
                                <xsl:value-of select="Name" /> 
                                </td>   
                        </tr>                   
                        
                        
                        </table>
                        </xsl:for-each>

Best regards

Jose



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



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