W3C home > Mailing lists > Public > xproc-dev@w3.org > June 2012

Re: p:add-attribute

From: Nic Gibson <nicg@corbas.co.uk>
Date: Fri, 22 Jun 2012 10:33:22 +0100
Cc: XProc Dev <xproc-dev@w3.org>
Message-Id: <3A53E7FE-FE9E-4FF9-9347-6CABB19AA197@corbas.co.uk>
To: mozer <xmlizer@gmail.com>
OK. So, it must have been some sort of "in a big rush before I left the house" issue because this morning it works fine. 
Thanks anyway. Apologies for wasting time

cheers

nic

On 21 Jun 2012, at 20:41, mozer wrote:

> Hi Nic,
> 
> Doing this simple sample
> 
> <?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">
>     <p:inline>
>       <doc>Hello world!</doc>      
>     </p:inline>
>   </p:input>
>   <p:output port="result"/>
>   <p:option name="test" required="true"/>
>   <p:identity/>
>   <p:add-attribute attribute-name="foo" match="/*">
>     <p:with-option name="attribute-value" select="$test"/>
>   </p:add-attribute>
> </p:declare-step>
> 
> 
> I get
> 
>  <doc xmlns:c="http://www.w3.org/ns/xproc-step" foo="bar">Hello world!</doc>
> 
> Once I've set in the Options tab the value "bar" for the "test" option in Oxygen XML 13.2
> 
> May be you should look in another direction (namespace or probably the <p:pipe port="result" step="the-end"/> )
> 
> Hope this helps
> 
> Xmlizer
> 
> 2012/6/21 Nic Gibson <nicg@corbas.co.uk>
> Afternoon all. Been a while since I need to ask a dumb question but here I am again.
> 
> I'm trying to track down an odd behaviour of an XProc script when run within Oxygen. Specifically, I'm trying to output the input options because I may be configuring them wrongly in Oxygen. 
> That's led to my using p:add-attribute to dump out an input in the result document. 
> It's not working as I would expect. The relevant lines of the script are below:
> 
> <?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"
>     xmlns:cx="http://xmlcalabash.com/ns/extensions" name="docx2xml"
>     xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
>     xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
>     xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
>     xmlns:rels="http://schemas.openxmlformats.org/package/2006/relationships" version="1.0"
>      type="corbas:docx2xml"
>     xmlns:corbas="http://www.corbas.co.uk/ns/xproc" xmlns:temp="http://www.corbas.co.uk/ns/temp">
> 
>     <p:output port="result" primary="true">
>         <p:pipe port="result" step="the-end"/>
>     </p:output>
> 
>     <p:option name="package-url" required="true"/>
> 
>     <p:import href="library-1.0.xpl"/>
> 
> 
> 	<!-- A large amount of code deleted here -->
>         
>     <p:identity name="create-sequence">
>         <p:input port="source">
>             <p:pipe port="result" step="get-doc"/>
>             <p:pipe port="result" step="get-styles"/>
>             <p:pipe port="result" step="get-numbering"/>
>             <p:pipe port="result" step="get-footnotes"/>
>             <p:pipe port="result" step="get-endnotes"/>
>             <p:pipe port="result" step="get-app-properties"/>
>             <p:pipe port="result" step="get-core-properties"/>
>         </p:input>
>     </p:identity>
> 
>     <p:wrap-sequence name="wrap-up" wrapper="word-doc"
>         wrapper-namespace="http://www.corbas.co.uk/ns/temp"/>
> 
>     <p:add-attribute name="insert-url" xmlns:temp="http://www.corbas.co.uk/ns/temp"
>         attribute-name="package-url" 
>          match="/temp:word-doc">
>         <p:with-option name="attribute-value" select="$package-url"/>
>     </p:add-attribute>
> 
> 
> The problem is the attribute value. It's empty. My result document now looks like:
> 
> <word-doc xmlns="http://www.corbas.co.uk/ns/temp" package-url="">
> 		<!-- several thousand lines of markup -->
> </word-doc>
> 
> What blindingly obvious thing am I doing wrong given that 'package-url' definitely has the right value at the start of this script (when run from the command line)?
> 
> cheers
> 
> nic
> 
> --
> Corbas Consulting / @CorbasLtd
> Digital Publishing Consultancy and Training
> http://www.corbas.co.uk, +44 (0)7718 906817/+44 (0)1273 930765	
> 	
> 
> 

--
Corbas Consulting / @CorbasLtd
Digital Publishing Consultancy and Training
http://www.corbas.co.uk, +44 (0)7718 906817/+44 (0)1273 930765	
	
Received on Friday, 22 June 2012 09:33:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 09:33:50 GMT