general-values + command line arg bug ? #139

Closed
mricaud opened this Issue Jan 24, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@mricaud

mricaud commented Jan 24, 2014

When general-values is enable and that one try to pass command line params with -p then one get an error :
SEVERE: com.xmlcalabash.core.XProcException: Unexpexted null value in getValue()

Example :

java -jar calabash.jar -p param1=foo test.xpl

        <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" 
                        xmlns:c="http://www.w3.org/ns/xproc-step" 
                        xmlns:cx="http://xmlcalabash.com/ns/extensions" 
                        xmlns:cxf="http://xmlcalabash.com/ns/extensions/fileutils" 
                        xmlns:cxo="http://xmlcalabash.com/ns/extensions/osutils" 
                        xmlns:cxu="http://xmlcalabash.com/ns/extensions/xmlunit" 
                        xmlns:ml="http://xmlcalabash.com/ns/extensions/marklogic" 
                        xmlns:pos="http://exproc.org/proposed/steps/os" 
                        xmlns:pxf="http://exproc.org/proposed/steps/file" 
                        xmlns:pxp="http://exproc.org/proposed/steps" 
                        xmlns:exf="http://exproc.org/standard/functions" 
                        xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                        version="1.0"
                        name="main">

            <p:input port="source" primary="true" sequence="true"><p:empty/></p:input>
            <p:input port="parameters" kind="parameter" primary="true"/>
            <p:output port="result" primary="true" sequence="true"><p:empty/></p:output>

            <p:parameters name="params">
                <p:input port="parameters">
                    <p:pipe step="main" port="parameters"/> <!-- error come from here -->
                </p:input>
            </p:parameters>

            <p:store href="params.xml">
                <p:input port="source"><p:pipe port="result" step="params"></p:pipe></p:input>
            </p:store>

        </p:declare-step>
@mricaud

This comment has been minimized.

Show comment
Hide comment
@mricaud

mricaud Jan 24, 2014

Well this is maybe not a bug, just an information "when general-values is enable, every params has to be directly interpreted from xproc" there is no casting apply from the command line...

Quite confused with this, I actualy have the problem even when no passing parameters but just trying to pipe the parameters port.

mricaud commented Jan 24, 2014

Well this is maybe not a bug, just an information "when general-values is enable, every params has to be directly interpreted from xproc" there is no casting apply from the command line...

Quite confused with this, I actualy have the problem even when no passing parameters but just trying to pipe the parameters port.

@ndw

This comment has been minimized.

Show comment
Hide comment
@ndw

ndw Feb 8, 2014

Owner

I don't recall why I imposed that limitation. In any event, the "obvious" thing to do in this case is simply to turn the passed string value into an XdmItem as an XdmAtomicValue. That seems to fix the bug.

Owner

ndw commented Feb 8, 2014

I don't recall why I imposed that limitation. In any event, the "obvious" thing to do in this case is simply to turn the passed string value into an XdmItem as an XdmAtomicValue. That seems to fix the bug.

ndw added a commit that referenced this issue Feb 12, 2014

Attempt to fix issue #139; if a parameter wasn't initialized with a g…
…eneral value, create one from its string value

ndw added a commit that referenced this issue Feb 12, 2014

Attempt to fix issue #139; if a parameter wasn't initialized with a g…
…eneral value, create one from its string value

@ndw ndw closed this Feb 12, 2014

@mricaud

This comment has been minimized.

Show comment
Hide comment
@mricaud

mricaud Feb 12, 2014

Thank you Norm :)

mricaud commented Feb 12, 2014

Thank you Norm :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment