我想将 html 转换为 xml,执行转换 XSLT,但我看到这个错误:
<message>
Impossible to read XSLT from 'file:/home/antonmm/src/cardMarket/cocoon-cardmarket/src/main/resources/COB-INF/xsl/productCard.xsl', see nested exception
</message>
<stacktrace>
org.apache.cocoon.pipeline.SetupException: Impossible to read XSLT from 'file:/home/antonmm/src/cardMarket/cocoon-cardmarket/src/main/resources/COB-INF/xsl/productCard.xsl', see nested exception at org.apache.cocoon.sax.component.XSLTTransformer.loadXSLT(XSLTTransformer.java:168) at org.apache.cocoon.sax.component.XSLTTransformer.setConfiguration(XSLTTransformer.java:205) at ......
封锁在茧中:
<map:pipeline>
<map:match pattern="product">
<!-- <map:generate src="sample/p.xml"/> -->
<map:generate src="https://productweb.com"/>
<map:transform src="xsl/product.xsl" />
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
产品.xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:x="http://www.w3.org/1999/xhtml" />
<xsl:template match="/">
<img>
<xsl:apply-templates />
</img>
</xsl:template>
<xsl:template match="x:span[@class='prodImage']/x:img">
<xxx>
<value-of select="@src"/>
</xxx>
<xsl:template match="text()"/>
</xsl:stylesheet>