Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.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
Spring Saxon提取无关线_Spring_Xslt_Saxon - Fatal编程技术网

Spring Saxon提取无关线

Spring Saxon提取无关线,spring,xslt,saxon,Spring,Xslt,Saxon,我正在尝试报告Spring配置: 当然,XML有很多深度,重要的部分也非常深入。 有趣的流程可以总结如下,省略了多个属性元素 bean -property --list ---bean ----property name="phaseName" ----property name="pluginID ----property name="fileSpecifications" -----set -------bean --------property name="dataStoreName" v

我正在尝试报告Spring配置: 当然,XML有很多深度,重要的部分也非常深入。 有趣的流程可以总结如下,省略了多个属性元素

bean
-property
--list
---bean
----property name="phaseName"
----property name="pluginID
----property name="fileSpecifications"
-----set
-------bean
--------property name="dataStoreName" value="courses"
--------property name="columnNames"
---------list
----------value
----------value
<caption><xsl:value-of select="$phaseName" />
  from <xsl:value-of  select="$resourceName" /></caption>
<tr>
<td class="header">Bean Name</td><td class="header">Plugin Name</td>
<td class="header">DataStore Name</td>
</tr>
 <xsl:apply-templates select="document($fileName)/sb:beans/sb:bean" />
 <xsl:apply-templates
  select="document($fileName)/sb:beans/sb:bean/sb:property[@name='plugins']/sb:list" mode="plug-in"/>

</table>
</xsl:template>
在xsl中,我进入第二个bean级别,提取pluginID,然后找到“fileSpecifications”,在那里我得到“dataStoreName”。 我看不出有什么原因,Saxon还提取了包含大量空行和额外选项卡的值列表

<caption><xsl:value-of select="$phaseName" />
  from <xsl:value-of  select="$resourceName" /></caption>
<tr>
<td class="header">Bean Name</td><td class="header">Plugin Name</td>
<td class="header">DataStore Name</td>
</tr>
 <xsl:apply-templates select="document($fileName)/sb:beans/sb:bean" />
 <xsl:apply-templates
  select="document($fileName)/sb:beans/sb:bean/sb:property[@name='plugins']/sb:list" mode="plug-in"/>

</table>
</xsl:template>
额外的文本来自一个名为“columnNames”的属性,该属性在XSL文件的任何地方都没有引用。 在通过添加xsl:message语句进行调试时,我无法确定哪个模板正在执行此提取

<caption><xsl:value-of select="$phaseName" />
  from <xsl:value-of  select="$resourceName" /></caption>
<tr>
<td class="header">Bean Name</td><td class="header">Plugin Name</td>
<td class="header">DataStore Name</td>
</tr>
 <xsl:apply-templates select="document($fileName)/sb:beans/sb:bean" />
 <xsl:apply-templates
  select="document($fileName)/sb:beans/sb:bean/sb:property[@name='plugins']/sb:list" mode="plug-in"/>

</table>
</xsl:template>
如果这在邮件列表中很难阅读,我已经创建了一个博客条目,描述可以下载和执行的文件。 如果需要,我可以提供更多的示例阶段文件

<caption><xsl:value-of select="$phaseName" />
  from <xsl:value-of  select="$resourceName" /></caption>
<tr>
<td class="header">Bean Name</td><td class="header">Plugin Name</td>
<td class="header">DataStore Name</td>
</tr>
 <xsl:apply-templates select="document($fileName)/sb:beans/sb:bean" />
 <xsl:apply-templates
  select="document($fileName)/sb:beans/sb:bean/sb:property[@name='plugins']/sb:list" mode="plug-in"/>

</table>
</xsl:template>
xsl中有更高级别的处理,用于读取主配置并查找所有导入的文件。 它将文件与阶段匹配,以便可以按照处理阶段的相同顺序报告阶段。 xsl构建列表,然后依次处理每个文件

<caption><xsl:value-of select="$phaseName" />
  from <xsl:value-of  select="$resourceName" /></caption>
<tr>
<td class="header">Bean Name</td><td class="header">Plugin Name</td>
<td class="header">DataStore Name</td>
</tr>
 <xsl:apply-templates select="document($fileName)/sb:beans/sb:bean" />
 <xsl:apply-templates
  select="document($fileName)/sb:beans/sb:bean/sb:property[@name='plugins']/sb:list" mode="plug-in"/>

</table>
</xsl:template>
即使删除了提取dataStoreName值属性的代码,仍然会得到值的columnNames列表

<caption><xsl:value-of select="$phaseName" />
  from <xsl:value-of  select="$resourceName" /></caption>
<tr>
<td class="header">Bean Name</td><td class="header">Plugin Name</td>
<td class="header">DataStore Name</td>
</tr>
 <xsl:apply-templates select="document($fileName)/sb:beans/sb:bean" />
 <xsl:apply-templates
  select="document($fileName)/sb:beans/sb:bean/sb:property[@name='plugins']/sb:list" mode="plug-in"/>

</table>
</xsl:template>
这是一个已知的错误还是我做了一些愚蠢的事情

<caption><xsl:value-of select="$phaseName" />
  from <xsl:value-of  select="$resourceName" /></caption>
<tr>
<td class="header">Bean Name</td><td class="header">Plugin Name</td>
<td class="header">DataStore Name</td>
</tr>
 <xsl:apply-templates select="document($fileName)/sb:beans/sb:bean" />
 <xsl:apply-templates
  select="document($fileName)/sb:beans/sb:bean/sb:property[@name='plugins']/sb:list" mode="plug-in"/>

</table>
</xsl:template>
从输出中提取

<tr>
   <td class="header">Bean Name</td>
   <td class="header">Plugin Name</td>
   <td class="header">DataStore Name</td>
 </tr>

 <tr>
    <td class="id">CourseWriterOutputting a row</td>    
    <td class="pluginId">Plugin ID:CourseFileWriter<br>Usage Description</td>
    <td class="dataStoreName"></td>
    <td>
                 courses

                   TITLE
                   PMI_REPORTING_NUMBER
                   IIBA_REPORTING_NUMBER
                   DEFAULT_CURRENCY
                   PRICE
                   OFFERING_TEMPLATE_NO
                   ABSTRACT
<caption><xsl:value-of select="$phaseName" />
  from <xsl:value-of  select="$resourceName" /></caption>
<tr>
<td class="header">Bean Name</td><td class="header">Plugin Name</td>
<td class="header">DataStore Name</td>
</tr>
 <xsl:apply-templates select="document($fileName)/sb:beans/sb:bean" />
 <xsl:apply-templates
  select="document($fileName)/sb:beans/sb:bean/sb:property[@name='plugins']/sb:list" mode="plug-in"/>

</table>
</xsl:template>

豆名
插件名称
数据存储名称
CourseWriter输出一行
插件ID:CourseFileWriter
用法说明 课程 标题 PMI报告编号 IIBA_报告编号 默认货币 价格 提供模板号 摘要

xsl的摘录是 输出表格 /xsl:variable>

<caption><xsl:value-of select="$phaseName" />
  from <xsl:value-of  select="$resourceName" /></caption>
<tr>
<td class="header">Bean Name</td><td class="header">Plugin Name</td>
<td class="header">DataStore Name</td>
</tr>
 <xsl:apply-templates select="document($fileName)/sb:beans/sb:bean" />
 <xsl:apply-templates
  select="document($fileName)/sb:beans/sb:bean/sb:property[@name='plugins']/sb:list" mode="plug-in"/>

</table>
</xsl:template>

从…起
Bean名称插件名称
数据存储名称

有人建议可能是XSLT内置模板,我发现了它,这为我提供了如何查找漏洞的提示。
这导致了对单个输入文件版本的测试,使我能够找到泄漏源。
我需要收紧内部应用模板上的select,以便它只显示我想要的
,而不是所有属性。
我将用修改后的源代码更新博客文章。
我在原始参考资料中没有遇到任何问题,但您在10年后的观点非常好。

我不愿意发布几百行代码和更多行输入,但即使没有看到代码,您也确定了我悲伤的根源。

有人建议这可能是XSLT内置模板,我发现了它,它为我提供了如何查找漏洞的提示。
<caption><xsl:value-of select="$phaseName" />
  from <xsl:value-of  select="$resourceName" /></caption>
<tr>
<td class="header">Bean Name</td><td class="header">Plugin Name</td>
<td class="header">DataStore Name</td>
</tr>
 <xsl:apply-templates select="document($fileName)/sb:beans/sb:bean" />
 <xsl:apply-templates
  select="document($fileName)/sb:beans/sb:bean/sb:property[@name='plugins']/sb:list" mode="plug-in"/>

</table>
</xsl:template>
这导致了对单个输入文件版本的测试,使我能够找到泄漏源。
我需要收紧内部应用模板上的select,以便它只显示我想要的
,而不是所有属性。
我将用修改后的源代码更新博客文章。
我在原始参考资料中没有遇到任何问题,但您在10年后的观点非常好。

我不愿意发布几百行代码和更多行输入,但即使没有看到代码,您也确定了我悲伤的根源。

请显示完整、可复制的代码示例,而不是“摘录”。对于XSLT问题,这意味着一个完整的XSLT样式表、一个完整的输入XML文档和您期望的输出。帮助:。即使我在你的帖子中看到了链接(我通常不会这样做:所以不鼓励这样的链接,因为10年后人们还会访问这个问题),我也看不到XSLT代码。如果没有看到XSLT代码,我无法帮助您调试它。获得比您想要的更多输出的最常见原因是,它是由内置模板规则生成的,当您有一个应用模板选择一个没有明确模板规则的节点时,会触发该规则。请显示完整的、可复制的代码示例,而不是“提取”。对于XSLT问题,这意味着一个完整的XSLT样式表、一个完整的输入XML文档和您期望的输出。帮助:。即使我在你的帖子中看到了链接(我通常不会这样做:所以不鼓励这样的链接,因为10年后人们还会访问这个问题),我也看不到XSLT代码。如果没有看到XSLT代码,我无法帮助您调试它。获得比您想要的更多输出的最常见原因是,它是由内置模板规则生成的,当您有一个apply templates(应用模板)选择了一个没有显式模板规则的节点时,会触发该规则。
<caption><xsl:value-of select="$phaseName" />
  from <xsl:value-of  select="$resourceName" /></caption>
<tr>
<td class="header">Bean Name</td><td class="header">Plugin Name</td>
<td class="header">DataStore Name</td>
</tr>
 <xsl:apply-templates select="document($fileName)/sb:beans/sb:bean" />
 <xsl:apply-templates
  select="document($fileName)/sb:beans/sb:bean/sb:property[@name='plugins']/sb:list" mode="plug-in"/>

</table>
</xsl:template>