xincludexinclude
XInclude processing
Home > Books > NetKernel API and Services Reference > Accessor Listing > XML Accessors > xinclude

Rate this page:
Really useful
Satisfactory
Not helpful
Confusing
Incorrect
Unsure
Extra comments:


Module

urn:org:ten60:netkernel:ext:xml:ura

The xinclude accessor is exported by the urn:org:ten60:netkernel:ext:xml:ura module. Import this module to gain access to the accessor.

Syntax

URI
active:xinclude

ArgumentRulesDescription
operandMandatory required the resource to substitute xincludes

Example Usage

DPML

<instr>
  <type>xinclude</type>
  <operand>foo.xml</operand>
  <target>bar.xml</target>
</instr>

NetKernel Foundation API

req=context.createSubRequest("active:xinclude");
req.addArgument("operand", [resource representation, aspect, or URI] );
result=context.issueSubRequest(req);

Purpose

The xinclude accessor is used to substitute xinclude declarations in the operand document with the resource referenced by the xinclude. XInclude is a W3C standard for incorporating resources into an XML resource.

Xinclude uses the kernel to obtain resources. At present xinclude only supports XML resources. An optional xml:base attribute can be used to specifiy the URI form which relative URI's are to be resolved.

Here is an example document with xincludes

<aroot xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="http://someserver/some/path/resource.xml">
    <xi:fallback>
      <xi:include href="localresource.xml" />
    </xi:fallback>
  </xi:include>
</aroot>

If the included reference cannot be found an optional fallback resource may be used.

© 2003-2007, 1060 Research Limited. 1060 registered trademark, NetKernel trademark of 1060 Research Limited.