Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml 如何在webstorm中启用XInclude for XSLT?_Xml_Xslt_Intellij Idea_Webstorm_Xinclude - Fatal编程技术网

Xml 如何在webstorm中启用XInclude for XSLT?

Xml 如何在webstorm中启用XInclude for XSLT?,xml,xslt,intellij-idea,webstorm,xinclude,Xml,Xslt,Intellij Idea,Webstorm,Xinclude,我有这样的xml: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <?xml-stylesheet type="text/xsl" href="index.xsl"?> <content> <include xmlns="http://www.w3.org/2001/XInclude" href="static.xml" parse="xml"/> <user

我有这样的xml:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="index.xsl"?>
<content>
    <include xmlns="http://www.w3.org/2001/XInclude" href="static.xml" parse="xml"/>
    <user authorizeds="false"/>
</content>

但是webstorm XSLTRunner并没有实际执行include。如何启用它?
我在最新java版本的Windows 8上运行它。

使用XInclude的XSLT实现:

<content xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="example.xml"/>
  <user authorizeds="false"/>
</content>

通过将模板添加到现有样式表:

<!-- ==============================================================
     XInclude implementation

     Implements XInclude by processing the entire doc
     to produce a single result tree with all the includes resolved
     and then applies the normal template processing to that document.
     ==============================================================-->
<xsl:template match="/">
 <xsl:choose>
   <xsl:when test="//xi:include">
     <xsl:variable name="resolved-doc">
       <xsl:apply-templates  mode="xinclude"/>
     </xsl:variable>
     <xsl:apply-templates select="$resolved-doc" mode="normal"/>
   </xsl:when>
   <xsl:otherwise>
     <xsl:apply-templates/>
   </xsl:otherwise>
 </xsl:choose>
</xsl:template>

<xsl:template match="/" mode="normal">
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="node()" mode="xinclude">
  <xsl:copy
    ><xsl:call-template name="xinclude-copy-attributes"
    /><xsl:apply-templates select="node()" mode="xinclude" 
  /></xsl:copy>
</xsl:template>

<xsl:template match="xi:include" mode="xinclude">
  <xsl:variable name="xpath" select="@href"/>
  <xsl:choose>
    <xsl:when test="$xpath != ''">
      <xsl:message>Including <xsl:value-of 
      select="$xpath"/></xsl:message>
      <xsl:apply-templates 
      select="xptrf:resolve-xpointer-url(.)" mode="xinclude"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:message>Xinclude: Failed to get a value for the href= attribute 
      of xi:include element.</xsl:message>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

</xsl:stylesheet>

包括…在内
Xinclude:无法获取href=属性的值
第十一章:包含元素。
参考资料