This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Unable to access all element using document function


                                                                      
Hi all,                                                               
                                                                      
I'm having trouble accessing all elements in a file using document    
function.                                                             
I'm using the Xalan  processor.                                       
                                                                      
All I want to do is to be able to access each element in a document   
(unsing document('fileA.xml'))  for manipulating these elements       
afterwards.                                                           
(calling a specific template)                                         
                                                                      
I can access a particular element :                                   
  <xsl:value-of select="document('fileA.xml')//relation/@type"/>      
                                                                      
but I dont know how access all elements in a sequential way.          
                                                                      
                                                                      
I have the following template:                                        
                                                                      
                                                                      
<xsl:template name ="ExtractInfoDoc" >                                
<xsl:param name="FileA" />                                            
                                                                      
  <xsl:for-each select="document($FileA)//*">                         
                                                                      
    <xsl:value-of select="document($FileA)//relation/@type"/>         
    <xsl:value-of select="document($FileA)//relation/role/@name"/>    
    <xsl:value-of select="document($FileA)/*/object/@id"/>            
                                                                      
  </xsl:for-each>                                                     
                                                                      
</xsl:call-template>                                                  
                                                                      
my interpretation of this template is:                                
                                                                      
For each  element in the document 'FileA.xml' display the relation    
type,                                                                 
relation role name, and object id  values.                            
                                                                      
The problem is that I only display the first element values.          
                                                                      
                                                                      
I'm so confused  if anyone has any  tips for me it would be           
much apreaciated.                                                     
                                                                      
Caroline                                                              

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]