Extract a subset of XML file using XSL

前端 未结 3 1441
伪装坚强ぢ
伪装坚强ぢ 2021-01-04 13:04

I have this XML file:


    error Code
    msg
    

        
相关标签:
3条回答
  • 2021-01-04 13:46

    Use :

    <xsl:copy-of select="/Response/ResponseParameters/node()"/>
    

    The "//" abbreviation is very expensive (causes the complete XML document to be scanned), and should be avoided.

    0 讨论(0)
  • 2021-01-04 13:46

    One way is to pass a parameter containing the node name into the XSLT and use the parameter passed in with the name() function to match the dynamic node.

    Edit:

    But in this simple case either of the other answers suggesting ResponseParameters//* or ResponseParameters/* are a far simpler solution.

    0 讨论(0)
  • 2021-01-04 13:57
    <xsl:copy-of select="Response/ResponseParameters//*"/>
    
    0 讨论(0)
提交回复
热议问题