Re: Namespace bindings

On 8/6/07, Norman Walsh <ndw@nwalsh.com> wrote:
> Do we expect the following pipeline to work?
>
> <p:pipeline xmlns:p="...">
>   <p:option name="delete" value="html:div"
>             xmlns:html="http://www.w3.org/1999/xhtml"/>

Here there is no need to declare html since value is just a string

>
>   <p:delete>
>     <p:input port="source">
>       <p:inline>
>         <html xmlns="http://www.w3.org/1999/xhtml">
>         <head>...</head>
>         <body>
>           <h1>Delete My Divs</h1>
>           <div>
>             ...
>           </div>
>         </body>
>       </p:inline>
>     </p:input>
>
>     <p:option name="match" select="$delete"/>

Here the inscope namespace do not contains html so it is a error
--> I have only one problem : WHICH ERROR ?

>   </p:delete>
> </p:pipeline>
>
> Where "work" means that the pipeline runs and produces:
>
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>...</head>
> <body>
>   <h1>Delete My Divs</h1>
> </body>

No (see above)


>
> Suppose local.xml contains:
>
>   <commands>
>     <delete xmlns:h="http://www.w3.org/1999/xhtml"
>             match="h:div"/>
>   </commands>
>
> Do we expect this to work?
>
> <p:pipeline xmlns:p="...">
>   <p:load name="load-commands" href="local.xml"/>
>
>   <p:delete>
>     <p:input port="source">
>       <p:inline>
>         <html xmlns="http://www.w3.org/1999/xhtml">
>         <head>...</head>
>         <body>
>           <h1>Delete My Divs</h1>
>           <div>
>             ...
>           </div>
>         </body>
>       </p:inline>
>     </p:input>
>
>     <p:option name="match" select="/commands/delete/@match">
>       <p:pipe step="load-commands" port="result"/>
>     </p:option>
>   </p:delete>
> </p:pipeline>

This one is trickier : it depends if we adopt the strategy to augment
the available namespaces with the one in the context of the XPath
expression

If not, then it is the same (unknown) error as above

Mohamed


-- 
Innovimax SARL
Consulting, Training & XML Development
9, impasse des Orteaux
75020 Paris
Tel : +33 9 52 475787
Fax : +33 1 4356 1746
http://www.innovimax.fr
RCS Paris 488.018.631
SARL au capital de 10.000 €

Received on Monday, 6 August 2007 22:57:34 UTC