xsltproc: xsl:version: 仅支持 1.1 功能
xsltproc: xsl:version: only 1.1 features are supported
不想在这里做任何壮观的事情,只是在寻找,真的,任何类型的简单 xslt
,它将 运行 来自 xsltproc
并提供相当有趣的输出——但简单.
thufir@dur:~/jaxb/ship$
thufir@dur:~/jaxb/ship$ ls
a.xslt shiporder.xml
thufir@dur:~/jaxb/ship$
thufir@dur:~/jaxb/ship$ cat shiporder.xml
<?xml version="1.0" encoding="UTF-8"?>
<shiporder orderid="889923"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="shiporder.xsd">
<orderperson>John Smith</orderperson>
<shipto>
<name>Ola Nordmann</name>
<address>Langgt 23</address>
<city>4000 Stavanger</city>
<country>Norway</country>
</shipto>
<item>
<title>Empire Burlesque</title>
<note>Special Edition</note>
<quantity>1</quantity>
<price>10.90</price>
</item>
<item>
<title>Hide your heart</title>
<quantity>1</quantity>
<price>9.90</price>
</item>
</shiporder>
thufir@dur:~/jaxb/ship$
thufir@dur:~/jaxb/ship$ trang shiporder.xml shiporder.xsd
thufir@dur:~/jaxb/ship$
thufir@dur:~/jaxb/ship$ ls
a.xslt shiporder.xml shiporder.xsd xsi.xsd
thufir@dur:~/jaxb/ship$
thufir@dur:~/jaxb/ship$ cat shiporder.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xs:import namespace="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="xsi.xsd"/>
<xs:element name="shiporder">
<xs:complexType>
<xs:sequence>
<xs:element ref="orderperson"/>
<xs:element ref="shipto"/>
<xs:element maxOccurs="unbounded" ref="item"/>
</xs:sequence>
<xs:attribute name="orderid" use="required" type="xs:integer"/>
<xs:attribute ref="xsi:noNamespaceSchemaLocation" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="orderperson" type="xs:string"/>
<xs:element name="shipto">
<xs:complexType>
<xs:sequence>
<xs:element ref="name"/>
<xs:element ref="address"/>
<xs:element ref="city"/>
<xs:element ref="country"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="name" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="country" type="xs:NCName"/>
<xs:element name="item">
<xs:complexType>
<xs:sequence>
<xs:element ref="title"/>
<xs:element minOccurs="0" ref="note"/>
<xs:element ref="quantity"/>
<xs:element ref="price"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="title" type="xs:string"/>
<xs:element name="note" type="xs:string"/>
<xs:element name="quantity" type="xs:integer"/>
<xs:element name="price" type="xs:decimal"/>
</xs:schema>
thufir@dur:~/jaxb/ship$
thufir@dur:~/jaxb/ship$ cat xsi.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xs:import schemaLocation="shiporder.xsd"/>
<xs:attribute name="noNamespaceSchemaLocation" type="xs:NCName"/>
</xs:schema>
thufir@dur:~/jaxb/ship$
thufir@dur:~/jaxb/ship$ cat a.xslt
<?xml version="1.0" encoding="utf-8"?><xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:copy-of select="unparsed-text(static-base-uri())"/>
</xsl:template>
</xsl:stylesheet>
thufir@dur:~/jaxb/ship$
thufir@dur:~/jaxb/ship$ xsltproc a.xslt shiporder.xml > output.xml
compilation error: file a.xslt line 1 element stylesheet
xsl:version: only 1.1 features are supported
xmlXPathCompOpEval: function static-base-uri not found
XPath error : Unregistered function
xmlXPathCompiledEval: evaluation failed
no result for shiporder.xml
thufir@dur:~/jaxb/ship$
xml
是 from w3school -- 坦率地说,我认为只是希望使用 xsltproc
生成某种输出,这意味着 xslt
版本 1。
xsltproc
使用仅支持 XSLT 1.0 或 1.1(在某些配置中)的 libxslt
处理器。
您的 XSLT 包含:
<xsl:copy-of select="unparsed-text(static-base-uri())"/>
static-base-uri()
是一个 XPath 2.0 函数,您的处理器无法处理它 - 这就是您看到的原因:
xmlXPathCompOpEval: function static-base-uri not found
XPath error : Unregistered function
请注意,unparsed-text()
是一个 XSLT 2.0 函数,如果处理器执行到这一步,您也会遇到错误。
just looking to generate some sort of output using xsltproc
初学者试试 identity transform?
不想在这里做任何壮观的事情,只是在寻找,真的,任何类型的简单 xslt
,它将 运行 来自 xsltproc
并提供相当有趣的输出——但简单.
thufir@dur:~/jaxb/ship$
thufir@dur:~/jaxb/ship$ ls
a.xslt shiporder.xml
thufir@dur:~/jaxb/ship$
thufir@dur:~/jaxb/ship$ cat shiporder.xml
<?xml version="1.0" encoding="UTF-8"?>
<shiporder orderid="889923"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="shiporder.xsd">
<orderperson>John Smith</orderperson>
<shipto>
<name>Ola Nordmann</name>
<address>Langgt 23</address>
<city>4000 Stavanger</city>
<country>Norway</country>
</shipto>
<item>
<title>Empire Burlesque</title>
<note>Special Edition</note>
<quantity>1</quantity>
<price>10.90</price>
</item>
<item>
<title>Hide your heart</title>
<quantity>1</quantity>
<price>9.90</price>
</item>
</shiporder>
thufir@dur:~/jaxb/ship$
thufir@dur:~/jaxb/ship$ trang shiporder.xml shiporder.xsd
thufir@dur:~/jaxb/ship$
thufir@dur:~/jaxb/ship$ ls
a.xslt shiporder.xml shiporder.xsd xsi.xsd
thufir@dur:~/jaxb/ship$
thufir@dur:~/jaxb/ship$ cat shiporder.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xs:import namespace="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="xsi.xsd"/>
<xs:element name="shiporder">
<xs:complexType>
<xs:sequence>
<xs:element ref="orderperson"/>
<xs:element ref="shipto"/>
<xs:element maxOccurs="unbounded" ref="item"/>
</xs:sequence>
<xs:attribute name="orderid" use="required" type="xs:integer"/>
<xs:attribute ref="xsi:noNamespaceSchemaLocation" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="orderperson" type="xs:string"/>
<xs:element name="shipto">
<xs:complexType>
<xs:sequence>
<xs:element ref="name"/>
<xs:element ref="address"/>
<xs:element ref="city"/>
<xs:element ref="country"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="name" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="country" type="xs:NCName"/>
<xs:element name="item">
<xs:complexType>
<xs:sequence>
<xs:element ref="title"/>
<xs:element minOccurs="0" ref="note"/>
<xs:element ref="quantity"/>
<xs:element ref="price"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="title" type="xs:string"/>
<xs:element name="note" type="xs:string"/>
<xs:element name="quantity" type="xs:integer"/>
<xs:element name="price" type="xs:decimal"/>
</xs:schema>
thufir@dur:~/jaxb/ship$
thufir@dur:~/jaxb/ship$ cat xsi.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xs:import schemaLocation="shiporder.xsd"/>
<xs:attribute name="noNamespaceSchemaLocation" type="xs:NCName"/>
</xs:schema>
thufir@dur:~/jaxb/ship$
thufir@dur:~/jaxb/ship$ cat a.xslt
<?xml version="1.0" encoding="utf-8"?><xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:copy-of select="unparsed-text(static-base-uri())"/>
</xsl:template>
</xsl:stylesheet>
thufir@dur:~/jaxb/ship$
thufir@dur:~/jaxb/ship$ xsltproc a.xslt shiporder.xml > output.xml
compilation error: file a.xslt line 1 element stylesheet
xsl:version: only 1.1 features are supported
xmlXPathCompOpEval: function static-base-uri not found
XPath error : Unregistered function
xmlXPathCompiledEval: evaluation failed
no result for shiporder.xml
thufir@dur:~/jaxb/ship$
xml
是 from w3school -- 坦率地说,我认为只是希望使用 xsltproc
生成某种输出,这意味着 xslt
版本 1。
xsltproc
使用仅支持 XSLT 1.0 或 1.1(在某些配置中)的 libxslt
处理器。
您的 XSLT 包含:
<xsl:copy-of select="unparsed-text(static-base-uri())"/>
static-base-uri()
是一个 XPath 2.0 函数,您的处理器无法处理它 - 这就是您看到的原因:
xmlXPathCompOpEval: function static-base-uri not found
XPath error : Unregistered function
请注意,unparsed-text()
是一个 XSLT 2.0 函数,如果处理器执行到这一步,您也会遇到错误。
just looking to generate some sort of output using
xsltproc
初学者试试 identity transform?