Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

XProc/Multiple XSLT Pipe

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Pipeline incorporating multiple XSLT transformations The following pipeline uses a sequence of three different transforms with each successive XSLT transformation using the results of the previous one. Each stylesheet is specified within a pipeline/xslt element that at minimum contains a stylesheet input with the stylesheet specified in an input/document/@href. <?xml version="1.0"?> <p:pipeline version="1.0" xmlns:p="http://www.w3.org/ns/xproc"> <p:xslt> <p:input port="stylesheet"> <p:document href="first.xsl"/> </p:input> </p:xslt> <p:xslt> <p:input port="stylesheet"> <p:document href="second.xsl"/> </p:input> </p:xslt> <p:xslt> <p:input port="stylesheet"> <p:document href="third.xsl"/> </p:input> </p:xslt> </p:pipeline> Parameters for multiple XSL transformations To pass parameters into the stylesheets from the XProc script use the with-param element. In the following example the first and third stylesheets both have a parameter named "foo". In the first stylesheet it is desired to have a "foo" parameter value be "one". In the third stylesheet it is desired to set a "foo" parameter to "three". <?xml version="1.0"?> <p:pipeline version="1.0" xmlns:p="http://www.w3.org/ns/xproc"> <p:xslt> <p:input port="stylesheet"> <p:document href="first.xsl"/> </p:input> <p:with-param name="foo" select="'one'"/> </p:xslt> <p:xslt> <p:input port="stylesheet"> <p:document href="second.xsl"/> </p:input> </p:xslt> <p:xslt> <p:input port="stylesheet"> <p:document href="third.xsl"/> </p:input> <p:with-param name="foo" select="'three'"/> </p:xslt> </p:pipeline>