DOMDocument :: load():属性构造错误; xslt,选择

时间:2016-04-29 18:50:01

标签: xml xslt

我试图简单地将xml文件中的路径向下走到一个元素。但它没有用。

的.xsl          

<xsl:template match="/">
<html>
<head><title></title></head>

<body>
<h2>ECU</h2>
  <table border="1">
    <tr bgcolor="#9acd32">
      <th>FRAMES</th>
      <th>TIME-PERIOD</th>
    </tr>
    <xsl:for-each select="AUTOSAR/AR-PACKAGES/AR-PACKAGE[SHORT-NAME='GMC']">
<!--    <xsl:for-each select="AUTOSAR/AR-PACKAGES/AR-PACKAGE">-->
    <tr>
        <td><xsl:value-of select="SHORT-NAME" /></td>
    </tr>
    </xsl:for-each>
  </table>
</body>
</html>
</xsl:template>

但是当我改变这条线时

<xsl:for-each select="AUTOSAR/AR-PACKAGES/AR-PACKAGE">

<xsl:for-each select="AUTOSAR/AR-PACKAGES/AR-PACKAGE[SHORT-NAME='GMC']">

结果就是从这里得到的 all Packages are shown

到包含错误的空白页:

DOMDocument::load(): attributes construct error

XML很大,可以发布它。 更新#1

.xsl是漏洞XSLT文件! 转换在PHP下在spache服务器(serverside)中完成(参见:http://www.w3schools.com/xsl/xsl_server.asp)。

例如XML代码段:

<?xml version="1.0" encoding="utf-8"?>
<!--
This file was saved with a tool from Vector Informatik GmbH
-->
<AUTOSAR xmlns="http://autosar.org/schema/r4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://autosar.org/schema/r4.0 AUTOSAR_4-1-1.xsd">
  <ADMIN-DATA/>
  <AR-PACKAGES>
    <AR-PACKAGE UUID="4820f45c-9a5b-49a2-883f-0c7540cf181f">
      <SHORT-NAME>GMC</SHORT-NAME>
            ...
    <AR-PACKAGE UUID="4820f45c-9a5b-49a2-883f-0c7540cf182f">
      <SHORT-NAME>AutosarTEPackage</SHORT-NAME>
            <ROOT-SW-COMPOSITION-PROTOTYPE UUID="9979918152ce3777d6360de31">
              <SHORT-NAME>HighFeatureRootCompositionType</SHORT-NAME>
              <SOFTWARE-COMPOSITION-TREF DEST="COMPOSITION-SW-COMPONENT-TYPE">/AutosarTEPackage/System/HighFeatureRootCompositionType</SOFTWARE-COMPOSITION-TREF>
            </ROOT-SW-COMPOSITION-PROTOTYPE>
    <AR-PACKAGE UUID="4820f45c-9a5b-49a2-883f-0c7540cf183f">
      <SHORT-NAME>Communication</SHORT-NAME>
...
...
    </AR-PACKAGE>
  </AR-PACKAGES>
</AUTOSAR>

0 个答案:

没有答案