W3C home > Mailing lists > Public > xproc-dev@w3.org > November 2013

Calabash string-replace problem

From: Paul Tyson <phtyson@sbcglobal.net>
Date: Thu, 14 Nov 2013 14:30:43 -0600
Message-Id: <B10339EF-842F-4F1E-AFF4-B36592C69EDB@sbcglobal.net>
To: "xproc-dev@w3.org" <xproc-dev@w3.org>
I must be missing something very simple, but I have tried everything I can think of. Thanks in advance for any assistance.
 
Here is the problem reduced to a simple pipeline.
 
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
                                xmlns:html="http://www.w3.org/1999/xhtml"
                                version="1.0">
 
  <p:output port="result"/>
 
  <p:option name="pn" select="'foo'"/>
 
  <p:string-replace match="//html:span/text()">
    <p:input port="source">
      <p:inline>
                <html:div>Part number <html:span style="font-weight:bold;font-size:larger">aaa</html:span> not found.</html:div>
      </p:inline>
    </p:input>
    <p:with-option name="replace" select="$pn"/>
  </p:string-replace>
 
</p:declare-step>
 
I expect to get:
 
  <html:div>Part number <html:span style="font-weight:bold;font-size:larger">foo</html:span> not found.</html:div>
 
(or whatever value has been given for ‘pn’).
 
But with calabash this either fails to replace the matching node, or causes an Exception (when invoked with the pipeline ‘pn’ option specified).
 
When run with calabash 1.0.15-94 and no options given on the command line:
 
                <html:div xmlns:html="http://www.w3.org/1999/xhtml">Part number <html:span style="font-weight:bold;font-size:larger"/> not found.</html:div>
     
--<document boundary>--------------------------------------------------------------------------
 
With command line pipeline option pn=a12345:
 
Nov 14, 2013 1:25:19 PM com.xmlcalabash.drivers.Main error
SEVERE: Pipeline failed: java.lang.NullPointerException
java.lang.NullPointerException
                at com.xmlcalabash.library.StringReplace.run(Unknown Source)
                at com.xmlcalabash.runtime.XAtomicStep.run(Unknown Source)
                at com.xmlcalabash.runtime.XPipeline.doRun(Unknown Source)
                at com.xmlcalabash.runtime.XPipeline.run(Unknown Source)
                at com.xmlcalabash.drivers.Main.run(Unknown Source)
                at com.xmlcalabash.drivers.Main.run(Unknown Source)
                at com.xmlcalabash.drivers.Main.main(Unknown Source)
 
This happens on 2 different linux platforms and a Windows platform, all running some version of java 1.6.
 
Regards,
--Paul
Received on Thursday, 14 November 2013 20:31:18 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:11 UTC