Choosing particular node groups in XSLT

There is an error that reads “xmlXPathCompOpEval: function node-set not found” and an XPath error that says “Unregistered function”. These errors occur when trying to evaluate the ‘select’ expression in line 58 of the file named “JayDataContextGenerator_OData_V2.xslt”. If you’re working with XSLT in Node.js, it’s recommended to use Saxon-JS, which is a pure JavaScript XSLT 3.0 runtime.


Question:

The XSLT code that I am presently utilizing creates tags solely on the root. I require the extraction of both

<row>

sets and

<config>

set.

Source Xml:


    2011-03-30
    84
    07:36
    
        2011-03-30
        84
        07:36
        91339082011-03-30T07:36:12
    
    
        
            7297364
            1
            33
            33
            1
            2011-03-30
            84
        
        
            7794473
            1
            60
            60
            1
            2011-03-30
            84
        
    
    
        
            13
            117.99
            2
            2011-03-30
            84
        
    
    
        
            2
            8.25
            3
            2011-03-30
            84
        
    

Attempted Xslt:


    
    
        
            
        
    

Desired Output:


    
        2011-03-30
        84
        07:36
        91339082011-03-30T07:36:12
    
    
        7297364
        1
        33
        33
        1
        2011-03-30
        84
    
    
        7794473
        1
        60
        60
        1
        2011-03-30
        84
    
    
        13
        117.99
        2
        2011-03-30
        84
    
    
        2
        8.25
        3
        2011-03-30
        84
    


Solution 1:

This concise and uncomplicated change.


 
 
 
     
       
     
 
 
  
 

When the provided XML document is subjected to this process.


    2011-03-30
    84
    07:36
    
        2011-03-30
        84
        07:36
        91339082011-03-30T07:36:12
    
    
        
            7297364
            1
            33
            33
            1
            2011-03-30
            84
        
        
            7794473
            1
            60
            60
            1
            2011-03-30
            84
        
    
    
        
            13
            117.99
            2
            2011-03-30
            84
        
    
    
        
            2
            8.25
            3
            2011-03-30
            84
        
    

Generates the desired, accurate outcome.


   
      2011-03-30
      84
      07:36
      91339082011-03-30T07:36:12
   
   
      7297364
      1
      33
      33
      1
      2011-03-30
      84
   
   
      7794473
      1
      60
      60
      1
      2011-03-30
      84
   
   
      13
      117.99
      2
      2011-03-30
      84
   
   
      2
      8.25
      3
      2011-03-30
      84
   

The following is an explanation.

  1. Employing and altering the principle of identity.

  2. Correct application of the <code>
    ancestor-or-self::
    </code> axis.


Solution 2:


I have solved it. This xslt is effective for my needs.


    
    
        
            
                
                    
                
            
            
                
                    
                
            
        
    
    
        
            
        
    

Frequently Asked Questions

Posted in Uncategorized