Move sub nodes into parent attributes with XSLT

后端 未结 2 1039
臣服心动
臣服心动 2021-01-06 15:07

I have some XML which contains records and sub records, like this:


    

        
2条回答
  •  鱼传尺愫
    2021-01-06 15:45

    This might do it, run this following snippet of XSLT when processing the top level elements:

    
        
            
        
    
    

    Essentially this iterates over each sub- element and creates an element describing the desired attribute. The position() function is called to get the relative position within the top level element: 1, 2, 3, etc.

    This is not a complete solution; some familiarity with XSLT is assumed.

提交回复
热议问题