W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > January 2012

RE: V.next: resource manager

From: <vojtech.toman@emc.com>
Date: Thu, 5 Jan 2012 09:36:02 -0500
To: <public-xml-processing-model-wg@w3.org>
Message-ID: <3799D0FD120AD940B731A37E36DAF3FE33FF222FAD@MX20A.corp.emc.com>
> Suppose http://example.com/doc.xml contains:
> 
>   <doc>
>     <a/>
>     <b/>
>     <c/>
>   </doc>
> 
> And consider this pipeline fragment:
> 
>   <p:delete match="a">
>     <p:input port="source">
>       <p:document href="http://example.com/doc.xml"/>
>     </p:input>
>   </p:delete>
> 
>   <p:sink/>
> 
>   <p:xinclude>
>     <p:input port="source">
>       <p:inline>
>         <book>
>           <xi:include href="http://example.com/doc.xml"/>
>         </book>
>       </p:inline>
>     </p:input>
>   </p:xinclude>
> 
> Assume for the moment that the p:delete step runs to completion before
> the p:xinclude step starts.
> 
> Which document does the p:xinclude step produce?
> 
>   <book>
>   <doc>
>     <a/>
>     <b/>
>     <c/>
>   </doc>
>   </book>
> 
> or
> 
>   <book>
>   <doc>
>     <b/>
>     <c/>
>   </doc>
>   </book>
> 
> I think the latter is the more useful, if perhaps more surprising,
> result.

Since we say that steps are side-effect free, I think it produces the former. I agree with you that the latter result might be more useful in some cases (and be really confusing in other cases), but I think you can achieve the same with something like this:

<p:delete match="a">
  <p:input port="source">
    <p:document href="http://example.com/doc.xml"/>
  </p:input>
</p:delete>
 
<p:store ext:resource-manager="true">
  <p:with-option name="href" select="base-uri()"/>
</p:store>

<p:xinclude>
  <p:input port="source">
    <p:inline>
      <book>
        <!-- loads the document from the resource manager -->
        <xi:include href="http://example.com/doc.xml"/>
      </book>
    </p:inline>
  </p:input>
</p:xinclude>

It relies on extensions, but not difficult to do.

Regards,
Vojtech

--
Vojtech Toman
Consultant Software Engineer
EMC | Information Intelligence Group
vojtech.toman@emc.com
http://developer.emc.com/xmltech
Received on Thursday, 5 January 2012 14:39:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 5 January 2012 14:39:20 GMT