xml - How does match works in xsl template? -
i have xsl this:
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" version="1.0"> <xsl:template match="wsdl:definitions"> <!-- code here --> </xsl:template> </xsl:stylesheet>
in xsl , line do:
<xsl:template match="wsdl:definitions">
from understanding going strictly match wsdl:definitions
tags <wsdl:definitions>
in given xml (correct me if i'm wrong here).
but literally confused moment, give input xml:
<xxx:definitions xmlns:xxx="http://schemas.xmlsoap.org/wsdl/" xmlns:xxxx1="http://www.w3.org/2006/05/addressing/wsdl" > </xxx:definitions>
it still matches <xxx:definitions>
, transformation needed. how can possible given in xsl sheet have given match wsdl:definitions
? match xmlns
of given input xml?
the namespace prefix name uri. if uris match namespaces identical. xmlns
adds prefix uri. there can many prefixes same namespace in single document.
so allowed use whatever prefixes want namespaces , xsl match them properly. documents originating different sources not needing use same prefixes , still understood.
Comments
Post a Comment