Using XSLT as an XML pre-processor

后端 未结 2 1878
春和景丽
春和景丽 2021-01-21 16:41

This is my first time doing anything with XSLT, or XML really, so please excuse me. I\'ve found XSLT web documentation is really terse.

I have an XML file that I want to

2条回答
  •  萌比男神i
    2021-01-21 17:08

    I've worked out how to do it as below, but some parts such as the "contents" variable didn't seem like the best way to handle this.

    Well, basically you got it right. You can still improve it a little, though:

    
    
    
      
    
      
        
      
    
    

    The changes the context node. Within it, the . refers to the node being iterated over, not the one that had been matched by the .

    That means you have to preseve the "outer" context in a variable, this is standard practice.

提交回复
热议问题