XInclude

Attributes

URI:http://www.xmlpipe.org/xpe/filter/include
Type:filter
Namespace:http://www.w3.org/2001/XInclude
Owner:http://www.xmlpipe.org/xpe

Description

This filter is very similar to the XInclude defined by W3C. A number of features have been added to make it more suitable for the XML pipe environment.

The filter reacts to the following XML fragment:


   <xi:include  href="{target uri}"  method="{POST|GET}"  xmlns:xi="http://www.w3.org/2001/XInclude" >
      <xi:content>
         {XML fragement to be POSTed to the target uri. Only valid if method is set to POST}
      </xi:content>
      <xi:fallback>
         {XML fragment or nested include element}
      </xi:fallback>
   </xi:include>

Elements

Element nameDescription
xi:xinclude
Main outer element. This element in mandatory and may contain a single xi:content element and a single xi:fallback element

Attributes

Attribute nameDescription
href
The URI of a resource. This is a mandatory attribute. The URI can be a relative URI that is resolved relative to the base URI of the deployed application (eg. If the base deployed URI is http://localhost:8188/xpe/ then a URI of test/resToInclude resolves to http://localhost:8188/xpe/test/resToInclude). Alternatively the URI can be an absolute URI such as http://www.google.com?...
method
HTTP Method. Can be GET or POST. This is an optional attribute that defaults to GET. If the method specified is POST then an XML fragment must be specified within the xi:content element. If the method specified is GET then any XML specified within the xi:content element will be ignored.

Example


   <xi:include  href="http://localhost:8188/xpe/text/xmlSourceURIToInclude"  method="GET"  xmlns:xi="http://www.w3.org/2001/XInclude" />

Example


   <xi:include  href="xmlSourceURIToInclude"  method="POST"  xmlns:xi="http://www.w3.org/2001/XInclude" >
      <xi:content>
         <authentication  xmlns="" >
            <username>
               fred
            </username>
            <password>
               flintstone
            </password>
         </authentication>
      </xi:content>
      <xi:fallback>
         <error  xmlns="" >
            <msg>
               URI not found
            </msg>
         </error>
      </xi:fallback>
   </xi:include>
xi:content
Content element. This element is mandatory if the method specified in the xi:include element is POST in which case the element must contain the XML to POST to the URI identified by the href attribute of the xi:include outer element.

Example


   <xi:content  xmlns:xi="http://www.w3.org/2001/XInclude" >
      <authentication  xmlns="" >
         <username>
            fred
         </username>
         <password>
            flintstone
         </password>
      </authentication>
   </xi:content>
xi:fallback
Fallback element. This element is optional and may contains the XML to be inserted if the URI identified by the href attribute is not found.

Example


   <xi:fallback  xmlns:xi="http://www.w3.org/2001/XInclude" >
      <error  xmlns="" >
         <msg>
            URI not found
         </msg>
      </error>
   </xi:fallback>