Re: Namespace bindings

/ Innovimax SARL <innovimax@gmail.com> was heard to say:
| 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

See 5.7.3.

|>   <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

Well, see 2.8.1.

The question is, do we *want* this to work. Should the namespace
binding associated with the option $delete be available on the
option named "match" because we refer to the $delete option?

| --> 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

I think we want to be consistent. Either both should be an error,
or neither.

The simplest thing to do is make it an error, but doing so makes the
"read from file" case not just an error sometimes, but sometimes it
can give the wrong result.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | Those who in their youth did not live
http://nwalsh.com/            | in self-harmony, and who did not gain
                              | the true treasures of life, are later
                              | like long-legged old herons standing
                              | sadly by a lake without fish.--The
                              | Dhammapada

Received on Monday, 6 August 2007 23:53:31 UTC