xmlxslt-2.0calabashxproc

Either a source document or an initial template must be specified


I'm trying to run the following xproc code which involves sequence of xslt steps in pipeline. However the Calabash is not able to read or get the source document although the 'href' link is clearly mentioned.

The following error is reported in oXygen editor:

E [Calabash XProc] "Either a source document or an initial template must be specified"

The following error is seen when running the calabash from console:

Mai 07, 2013 2:41:52 PM com.xmlcalabash.util.DefaultXProcMessageListener error SEVERE: err:XD0011:XProc error err:XD0011 Mai 07, 2013 2:41:52 PM com.xmlcalabash.drivers.Main error SEVERE: It is a dynamic error if the resource referenced by a p:document element does not exist, cannot be accessed, or is not a well-formed XML document. Mai 07, 2013 2:41:52 PM com.xmlcalabash.drivers.Main error SEVERE: Underlying exception: net.sf.saxon.s9api.SaxonApiException: I/O error re ported by XML parser processing C:stlConversionxprocstlxml.xpl: C:stlConversionx procstlxml.xpl (Das System kann die angegebene Datei nicht finden)

Can someone please help me with this error?

Heres my xproc code:



<p:output port="result" sequence="true">  
    <p:pipe step="pre-run" port="result"/>
    <p:pipe step="normalize-stl-xml" port="result"/>
    <p:pipe step="tf-transform" port="result"/>
    <p:pipe step="transformARDOnline" port="result"/>
    <p:pipe step="filterUnusedStyleLayout" port="result"/>
</p:output>

<p:xslt name="pre-run">
    <p:input port="source">
        <p:document href="file:/C:/stlConversion/temp/a.xml"/>
    </p:input>
    <p:input port="stylesheet">  
        <p:document href="file:/C:/stlConversion/xslt/test.xsl"/> 
    </p:input>  
    <p:input port="parameters">  
        <p:empty/> 
    </p:input>
</p:xslt>

<p:xslt name="normalize-stl-xml">
    <p:input port="source">  
        <p:pipe step="pre-run" port="result"/>
    </p:input>  
    <p:input port="stylesheet">  
        <p:document href="file:/C:/stlConversion/xslt/normalize_stl_xml.xsl"/> 
    </p:input>  
    <p:input port="parameters">  
        <p:empty/> 
    </p:input>
</p:xslt>

<p:xslt name="tf-transform">
    <p:input port="source">  
        <p:pipe step="normalize-stl-xml" port="result"/>
    </p:input>  
    <p:input port="stylesheet">  
        <p:document href="file:/C:/stlConversion/xslt/tf_test_transform.xsl"/> 
    </p:input>  
    <p:input port="parameters">  
        <p:empty/> 
    </p:input>
</p:xslt>

<p:xslt name="transformARDOnline">
    <p:input port="source">  
        <p:pipe step="tf-transform" port="result"/>
    </p:input>  
    <p:input port="stylesheet">  
        <p:document href="file:/C:/stlConversion/xslt/transformARDOnline.xslt"/> 
    </p:input>  
    <p:input port="parameters">  
        <p:empty/> 
    </p:input>
</p:xslt>

<p:xslt name="filterUnusedStyleLayout">
    <p:input port="source">  
        <p:pipe step="transformARDOnline" port="result"/>
    </p:input>  
    <p:input port="stylesheet">  
        <p:document href="file:/C:/stlConversion/xslt/filterUnusedStyleLayout.xslt"/> 
    </p:input>  
    <p:input port="parameters">  
        <p:empty/> 
    </p:input>
</p:xslt>

<p:store href="file:/C:/stlConversion/ebu-tt_ard_online.xml" media-type="text/xml"/>


Solution

  • There are TWO different error messages happening..

    Cannot find file..
    The latter simply indicated that Calabash is unable to read the .xpl file itself. The error message mentions a filepath that seems to be lacking directory separators. Perhaps something went wrong with the initial call to Calabash.

    This is the error message I get when I missspell the name of the .xpl:

    D:\Projecten\Persoonlijk\XProc\stack8>calabash testt.xpl
    mei 07, 2013 8:16:57 PM com.xmlcalabash.util.DefaultXProcMessageListener error
    SEVERE: err:XD0011:XProc error err:XD0011
    mei 07, 2013 8:16:57 PM com.xmlcalabash.drivers.Main error
    SEVERE: It is a dynamic error if the resource referenced by a p:document element does not exist, cannot be accessed, or is not a well-formed XML document.
    mei 07, 2013 8:16:57 PM com.xmlcalabash.drivers.Main error
    SEVERE: Underlying exception: net.sf.saxon.s9api.SaxonApiException: I/O error reported by XML parser processing file:/D:/Projecten/Persoonlijk/XProc/stack8/test
    t.xpl: D:\Projecten\Persoonlijk\XProc\stack8\testt.xpl (The system cannot find the file specified)
    

    Source document must be specified
    The first message is a bit misguiding though. It sounds like you forgot to bind input to an input port, but that is not the case. It is actually telling you that one of the p:xslt steps is receiving no input, not even an empty document-node.

    I was able to reproduce the error by adding a p:sink and a p:identity before any of the p:xslt steps as shown below:

    <p:declare-step name="main" xmlns:p="http://www.w3.org/ns/xproc"
      xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0">
    
        <p:input port="source" primary="true" sequence="true">
            <p:document href="temp/a.xml"/>
        </p:input>
        <p:input port="schema" sequence="true"/>
        <p:input port="stylesheet" sequence="true"/>
        <p:input port="parameters" sequence="true" kind="parameter"/>
    
        <p:output port="result" sequence="true">  
            <p:pipe step="pre-run" port="result"/>
            <p:pipe step="normalize-stl-xml" port="result"/>
            <p:pipe step="tf-transform" port="result"/>
            <p:pipe step="transformARDOnline" port="result"/>
            <p:pipe step="filterUnusedStyleLayout" port="result"/>
        </p:output>
    
        <p:xslt name="pre-run">
            <p:input port="stylesheet">  
                <p:document href="xslt/test.xsl"/> 
            </p:input>  
        </p:xslt>
    
        <p:sink/>
        <p:identity>
            <p:input port="source">
                <p:empty/>
            </p:input>
        </p:identity>
    
        <p:xslt name="normalize-stl-xml">
            <p:input port="stylesheet">  
                <p:document href="xslt/normalize_stl_xml.xsl"/> 
            </p:input>  
        </p:xslt>
    
        <p:xslt name="tf-transform">
            <p:input port="stylesheet">  
                <p:document href="xslt/tf_test_transform.xsl"/> 
            </p:input>  
        </p:xslt>
    
        <p:xslt name="transformARDOnline">
            <p:input port="stylesheet">  
                <p:document href="xslt/transformARDOnline.xslt"/> 
            </p:input>  
        </p:xslt>
    
        <p:xslt name="filterUnusedStyleLayout">
            <p:input port="stylesheet">  
                <p:document href="xslt/filterUnusedStyleLayout.xslt"/> 
            </p:input>  
        </p:xslt>
    
        <p:store href="ebu-tt_ard_online.xml" media-type="text/xml"/>
    
    </p:declare-step>
    

    I also added the input declarations as you mentioned in your comments. I did change the source input to primary. Primary inputs and outputs are bound automatically, so you can leave out all input source declarations as you can see from my code above. Same accounts for input of type parameter, which is bound automatically as well. By leaving them out, any command-line parameter is passed to p:xslt automatically.

    Not an exact answer, but hopefully it helps you get closer to the problem. Your code runs fine at my end with both Calabash 0.9.40 and 1.0.9-94, as far as I could tell without the actual input and xslt's.

    HTH!