- From: <vojtech.toman@emc.com>
- Date: Fri, 6 Jan 2012 03:28:16 -0500
- To: <public-xml-processing-model-wg@w3.org>
> How does this work if the mapping isn't known statically? I had in mind
> something like
>
> <p:uri-scope>
> <p:input port="catalog">
> ...
> </p:input>
>
> ...
> </p:uri-scope>
Norm, did you mean that you would pass some kind of a catalog document (for example in the c:catalog form that Henry suggested) to the "catalog" input port, or that you would just pass a bunch of XML documents as with any other step? It occurred to me that the latter might work, too - and you wouldn't even need the p:stash step.
The idea is that the p:uri-scope step/wrapper would take all documents passed to it via the "catalog" port, look at their base URIs, and construct a scoped catalog that would map all references to these base URIs in the sub-pipeline to the corresponding documents.
Applying this to your initial example, it might look as this:
<p:delete match="a" name="delete">
<p:input port="source">
<p:document href="http://example.com/doc.xml"/>
</p:input>
</p:delete>
<p:uri-scope>
<p:input port="catalog">
<p:pipe step="delete" port="result"/>
</p:input>
<p:xinclude>
<p:input port="source">
<p:inline>
<book>
<!-- loads the document from the nearest in-scope catalog -->
<xi:include href="http://example.com/doc.xml"/>
</book>
</p:inline>
</p:input>
</p:xinclude>
</p:uri-scope>
The obvious drawback of this solution is that you cannot map from a base URI A to a base URI B easily, but this could be solved easily by combining the above with the p:uri-scope/p:map-uri construct.
Regards,
Vojtech
--
Vojtech Toman
Consultant Software Engineer
EMC | Information Intelligence Group
vojtech.toman@emc.com
http://developer.emc.com/xmltech
Received on Friday, 6 January 2012 08:32:00 UTC