Linux command
saxon 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Transform an XML file
saxon -s:[source.xml] -xsl:[stylesheet.xsl] -o:[output.xml]
Run an XQuery
saxon -s:[source.xml] -q:[query.xq] -o:[output.xml]
Transform with a parameter
saxon -s:[source.xml] -xsl:[stylesheet.xsl] param=[value]
Execute a standalone XQuery file
saxon -q:[query.xq]
Run a schema-aware transformation
saxon -sa -s:[source.xml] -xsl:[stylesheet.xsl]
Transform with increased memory
java -Xmx1024m net.sf.saxon.Transform -s:[source.xml] -xsl:[stylesheet.xsl]
说明
Saxon is an XSLT and XQuery processor for transforming XML documents. It supports XSLT 3.0, XPath 3.1, and XQuery 3.1, enabling complex document transformations and queries. The tool processes XML input against XSLT stylesheets or XQuery expressions, producing transformed output. On many systems, wrapper scripts like saxonb-xslt and saxonb-xquery provide convenient command-line access. Saxon is available in three editions: Saxon-HE (open-source under MPL-2.0), Saxon-PE (professional), and Saxon-EE (enterprise with schema-awareness). It runs on Java, .NET, and JavaScript platforms.
参数
- -s:_file_
- Source XML document to process
- -xsl:_file_
- XSLT stylesheet for transformation
- -q:_file_
- XQuery file to execute
- -o:_file_
- Output file for results
- -sa
- Enable schema-aware processing
- -t
- Display timing information
- -explain
- Display compiled expression tree
- -versionmsg:off
- Suppress version message
- -xsd:_file_
- Schema document for validation
FAQ
What is the saxon command used for?
Saxon is an XSLT and XQuery processor for transforming XML documents. It supports XSLT 3.0, XPath 3.1, and XQuery 3.1, enabling complex document transformations and queries. The tool processes XML input against XSLT stylesheets or XQuery expressions, producing transformed output. On many systems, wrapper scripts like saxonb-xslt and saxonb-xquery provide convenient command-line access. Saxon is available in three editions: Saxon-HE (open-source under MPL-2.0), Saxon-PE (professional), and Saxon-EE (enterprise with schema-awareness). It runs on Java, .NET, and JavaScript platforms.
How do I run a basic saxon example?
Run `saxon -s:[source.xml] -xsl:[stylesheet.xsl] -o:[output.xml]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -s:_file_ do in saxon?
Source XML document to process