This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21042 - [XPROCTS] Test err:XD0008
Summary: [XPROCTS] Test err:XD0008
Status: NEW
Alias: None
Product: XML Processing Model
Classification: Unclassified
Component: Pipeline language (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Norman Walsh
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-18 17:19 UTC by Tim Mills
Modified: 2013-02-27 14:49 UTC (History)
1 user (show)

See Also:


Attachments

Description Tim Mills 2013-02-18 17:19:20 UTC
This test should not raise XD0008, because variable $value need not be evaluated.

The constant string "concat('test-',$value)" is passed to string-replace,  This step then interprets the string as an XPath expression according to the section 2.6.2.2 Step XPath Context, which states that the set of in-scope variables is "None, unless otherwise specified by the step", thus 

The source port of p:string-replace does not admit sequences, and the input to this test is a sequence of three documents.  Therefore, this test should expect XD0006.


<p:declare-step version="1.0" xmlns:p="http://www.w3.org/ns/xproc">
                <p:input port="source" sequence="true" />
                <p:output port="result" sequence="true" />

                <p:variable name="value" select="/doc/a" />

                <p:string-replace match="//doc" replace="concat('test-',$value)"
 />

    </p:declare-step>
Comment 1 Vojtech Toman 2013-02-27 14:49:42 UTC
I think XD0008 follows from https://www.w3.org/Bugs/Public/show_bug.cgi?id=21015#c1, but I agree that the use of p:string-replace and a sequence of documents is unnecessary and confusing.