Choosing between different namespaces in XSLT

前端 未结 1 820
南笙
南笙 2021-01-24 16:17

The XML I am expecting is supposed to be only one url/urn (xmlns:urn=\"urn:123:456\") like below:



        
相关标签:
1条回答
  • 2021-01-24 16:47

    You could declare both namespaces, e.g.

    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:ns1="urn:123:456"
    xmlns:ns2="urn:789:123"
    exclude-result-prefixes="ns1 ns2">
    

    Then use a union expression for your matches and selections, for example:

    <xsl:template match="/ns1:Document | /ns2:Document">
    
    0 讨论(0)
提交回复
热议问题