【发布时间】:2015-05-29 19:07:30
【问题描述】:
我对 XSL 有一些疑问。
- 我有以下 XSL 文件。
XSLT 2.0
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="main" match="/">
<xsl:for-each select="collection('file:///C:/Users/Quality/Documents/ProyectoComerciales/download_files/?select=*.txt;unparsed=yes')">
<xsl:variable name="file" select="tokenize(document-uri(.), '/')[last()]"/>
<xsl:variable name="name" select="substring-before($file,'.')"/>
<xsl:variable name="url" select="concat('file:///C:/Users/Quality/Documents/ProyectoComerciales/xml/',$name,'.xml')"/>
<xsl:result-document method="xml" indent="yes" href="{$url}">
<xsl:variable name="path" select="concat('file:///C:/Users/Quality/Documents/ProyectoComerciales/download_files/',$file)"/>
<xsl:variable name="text" select="tokenize(unparsed-text($path),'
')"/>
<download>
...
</download>
</xsl:result-document>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
但是有可能知道转换何时正确完成吗?
- 可以将 XSL 与数据库连接吗?因为我必须将转换的结果保存在我的数据库中
【问题讨论】:
-
您使用什么 xslt 处理器?它可能会以不同于
0...的退出代码终止... -
用 Java 中的 Saxon (sacon9eh.jar) 调用我的 XSL