Strange behavior with xml-namespace

半腔热情 提交于 2019-12-02 08:26:37

Even if you specify a certain namespace as the default namespace for your XSL, XPaths without a namespace prefix are always in the null namespace. You'll need to do something like this:

<xsl:stylesheet xmlns:mns="http://schema.mynamespace.net" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
   <xsl:output method="text"/>

   <xsl:template match="/">
     <xsl:apply-templates select="mns:warehouse/mns:container" />"
   </xsl:template>

   <xsl:template match="mns:container">
     <xsl:apply-templates />"
   </xsl:template>

</xsl:stylesheet>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!