xslt node-set use in key function - find children by parent attribute

前端 未结 1 861
情书的邮戳
情书的邮戳 2021-01-27 06:11

I have an XML File.


   
    
        
              


        
1条回答
  •  别那么骄傲
    2021-01-27 06:34

    Although this is not simple, I think you are making it much more complicated than it needs to be. Try the following stylesheet (not tested very thoroughly):

    XSLT 1.0

    
    
    
    
    
    
    
        newid_answer
        newid_number
    
    
    
    
    
    
    
    
        
            
                 
            
            
        
    
    
    
        
    
        
            
                
            
        
    
        
    
        
            
        
        
            
        
    
    
    
    

    Note: when you are in the context of a node-set created by the exslt:node-set() function, you cannot use a key() to lookup data in the source XML document, unless you switch the context to the source document first.

    0 讨论(0)
提交回复
热议问题