Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/9.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 如何读取处理说明属性?_Xml_Xslt_Xslt 1.0_Xslt 2.0 - Fatal编程技术网

Xml 如何读取处理说明属性?

Xml 如何读取处理说明属性?,xml,xslt,xslt-1.0,xslt-2.0,Xml,Xslt,Xslt 1.0,Xslt 2.0,我有XML格式的处理指令 当我们应用 <xsl:template match="Dest" > <?abc ?abc:Dest id="e47529cb-4d17-461b-8438-e3b6d9ec1a68"??> </xsl:template> 解决方案是: 输入: <abc> <?abc ?abc:Dest id="e47529cb-4d17-461b-8438-e3b6d9ec1a68"??> </abc>

我有XML格式的处理指令

当我们应用

<xsl:template match="Dest" >
    <?abc ?abc:Dest id="e47529cb-4d17-461b-8438-e3b6d9ec1a68"??>
</xsl:template>

解决方案是:

输入:

<abc>
<?abc ?abc:Dest id="e47529cb-4d17-461b-8438-e3b6d9ec1a68"??>
</abc>
<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="processing-instruction('abc')">
    <P-I><xsl:value-of select="substring-before(substring-after(.,'id=&quot;'),'&quot;')"/></P-I>
  </xsl:template>
</xsl:stylesheet>
<P-I>e47529cb-4d17-461b-8438-e3b6d9ec1a68</P-I>

XSLT:

<abc>
<?abc ?abc:Dest id="e47529cb-4d17-461b-8438-e3b6d9ec1a68"??>
</abc>
<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="processing-instruction('abc')">
    <P-I><xsl:value-of select="substring-before(substring-after(.,'id=&quot;'),'&quot;')"/></P-I>
  </xsl:template>
</xsl:stylesheet>
<P-I>e47529cb-4d17-461b-8438-e3b6d9ec1a68</P-I>

输出:

<abc>
<?abc ?abc:Dest id="e47529cb-4d17-461b-8438-e3b6d9ec1a68"??>
</abc>
<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="processing-instruction('abc')">
    <P-I><xsl:value-of select="substring-before(substring-after(.,'id=&quot;'),'&quot;')"/></P-I>
  </xsl:template>
</xsl:stylesheet>
<P-I>e47529cb-4d17-461b-8438-e3b6d9ec1a68</P-I>
e47529cb-4d17-461b-8438-e3b6d9ec1a68