xsl-list
[Top] [All Lists]

RE: RE: (No Subject) Nested for-each

2003-07-29 11:02:04
ok.
I send now a part of my XML file.

  <?xml version="1.0" ?> 
- <ERwin4 FileVersion="4100">
- <Model id="{37BEA408-F83C-4925-A681-2D9DA7E54E0C}+00000000" ModelType="3"
TargetServer="174" DBMSVersion="8">
- <Entity_Groups>
- <Entity id="{5431ABB1-9BB5-40E3-BB2E-0486638070A3}+00000000" Name="E/3">
- <EntityProps>
  <Name>E/3</Name> 
  <Type>1</Type> 
  <Index_Generate>1</Index_Generate> 
  <Physical_Only>false</Physical_Only> 
  <Physical_Name>NPRC_DIFE_CONTRL</Physical_Name> 
  </EntityProps>
- <Attribute_Groups>
- <Attribute id="{CB120696-68FD-424B-B906-21E62A2AF05B}+00000000"
Name="CODEVT">
- <AttributeProps>
  <Name>CODEVT</Name> 
  <Type>0</Type> 
  <Datatype>NUMBER(3)</Datatype> 
  <Null_Option>1</Null_Option> 
  <Order>1</Order> 
  <Physical_Order>1</Physical_Order> 
 
<Parent_Domain>{39146A35-A713-4CAA-9FBF-9AA575FA9F44}+00000003</Parent_Domai
n> 
  <DO_Color_Inherited>0</DO_Color_Inherited> 
  <DO_Font_Inherited>0</DO_Font_Inherited> 
  </AttributeProps>

-----Original Message-----
From: cknell(_at_)onebox(_dot_)com [mailto:cknell(_at_)onebox(_dot_)com]
Sent: terça-feira, 29 de Julho de 2003 18:46
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] RE: (No Subject) Nested for-each


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/Attr
ibute/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

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



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