Can XProc 3 handle any XPath 3.1 value/type?

While reading up on XProc 3 I wonder whether a step like an XSLT 3 stylesheet can return any type of the XSLT 3 or XPath 3.1 data model.The spec in http://spec.xproc.org/master/head/xproc/#documents.9 has a section saying If the result is a map, array or any atomic value, a JSON document is created and content-type application/json is used.I am struggling to understand what would happen with sequences in general, e.g. a sequence of arrays of nodes (e.g. type array(node())*) or a sequence of maps from an atomic type to a node (e.g. a type map...Read more

Sequence input to <p:filter> in XProc 1.0?

Is <p:filter> in XProc able to accept a sequence of documents as input? When I feed Calabash the following:<?xml version="1.0" encoding="UTF-8"?><p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0"> <p:input port="source" sequence="true"> <p:inline> <doc> <content>Hello world!</content> </doc> </p:inline> <p:inline> <doc> <cont...Read more

xproc - How to make p:xslt aggregate input from two sources

After reading the XProc question below:XSLT with XProc - parameter binding in the required typePassing document() parameter to an xslt in XProc pipelineIt seems impossible to pass document-node() type parameter to XSLT in XProc.So the only way to workaround is: generate temporary file and pass the URL of temporary file as parameter to XSLT. Look following example:big-command.xpl<?xml version="1.0" encoding="UTF-8"?><p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0"> <...Read more

Xproc p:http-request dynamic href URI

My Calabash xproc pipeline uses p:http-request to fire a GET request. The server requires authentication, so I use a c:request with username / password / auth-method attributes. I am struggling with the question how to fill the href attribute of c:request dynamically.Calabash doesn't seem to like: <c:request method="GET" href="{$href}" username="username" password="password" auth-method="basic" detailed="false"/>This is not a big surprise, because setting href dynamically would not work on p:load either. But in the latter case, adding a p...Read more

xproc - Output port with default fallback value?

(This is the counterpart of Source port with default fallback value?)I have an XProc pipeline where I would like the output to work like this:if a URL is provided on the command line using -oresult=foo.xml, then the result of the pipeline is written into that document;if no URL is provided, then the result should be written into default.xml.Is it possible to obtain this behaviour in XProc?The difference with the case of the default value for the input port is that the content of the <p:output> element are used as the default source of the...Read more

Xproc: how to use a variable in an href

I have a variable that holds the name of the stylesheet to apply next.This does not work:<p:variable name="filename" select="'/home/stylesheets/indent.xsl'"/><p:xslt> <p:input port="stylesheet"> <p:document href="{$filename}"/> </p:input></p:xslt>I think I have to do somekind of URI or IRI function on $filename, but I have not been able to figure it out.UPDATE: I went to the link that grtjn provided and lifted the <p:declare-step type="ut:xslt" name="current"> wrapper.Now applying the href fro...Read more

xproc - Source port with default fallback value?

I have an XProc step where I would like the input source to work like this:if a URL is provided on the command line using -isource=foo.xml, then the document at that URL is used as the source document;if no URL is provided, then the document default.xml should be used.Is it possible to obtain this behaviour in XProc?...Read more

Xproc (calabash): order of execution

I am trying to write an xproc that needs to do several p:xslt step sequentially. First, it writes two normalized XML files to disk and then a third p:xslt should take these normalized files as input.UPDATE: first problem (third p:xslt fires before second p:store finished writing to disk) solved by adding explicit connection between second p:store and third p:xslt. (modified in code below)UPDATE 2 Next problem is that I want to delete the temporary files with the pxf:delete instruction. This gives same order of execution problem: pxf:delete is f...Read more

How to generate doctype declarations dynamically in XProc?

Requirement: Is to add correct Doctype declaration on the output xml [The root element of the input xml can be chapter or section element]. For Instance, consider the chapter element public identifier is PUBLIC "-//OASIS//DTD DocBook Chap XML V4.5//EN" and system identifier is "chap.dtd". Simillary for section element public identifier is PUBLIC "-//OASIS//DTD DocBook Sec XML V4.5//EN" and system identifier is "sec.dtd".Input XML1: chapter.xml<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook Chap...Read more

xproc - Transformation outputs Non-XML documents

I just want to transform an input document (it's just a list of file references) to several output documents.this works: <p:xslt name="MainTransformation1-b"> <p:input port="source"> <p:pipe step="CI" port="result"/> </p:input> <p:input port="stylesheet"> <p:document href="Transform.xsl"/> </p:input> <p:with-param name="ProjectName" select="$Name"/> </p:xslt> <p:sink/> <p:for-each> <p:iteration-source&...Read more

XPROC - Generation of files in secondary port

My requirement is to generate one XML file and few HTML files in the secondary port. I have configured few steps in XProc. Here’s the sample code:<p:xslt name="create-document"> <p:input port="stylesheet"> <p:document href="stylesheet.xsl" /> </p:input> </p:xslt> <p:for-each> <p:iteration-source> <p:pipe step="create-document" port="secondary" /> </p:iteration-source> <p:store> <p:with-option name="doctype-public" select="'-//W3C//DTD XHTML 1.0 Frame...Read more