<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faqs SYSTEM 'dtd/faqs.dtd'>
<faqs title='Using XInclude'>

  <faq title="Usage">
    <q>How do I enable XInclude processing?</q>
    <a>
     <p>
      The simplest way to enable XInclude processing is to use a 
      <code>org.apache.xerces.parsers.XIncludeParserConfiguration</code> as your
      parser configuration.  This configuration includes a DTD validator, a namespace
      binder, and a Schema validator, in addition to a handler for XInclude.  See
      <link idref="faq-xni" anchor="override-default-config">this FAQ</link> for
      instructions about how to change your parser configuration.
     </p>
     <p>
      If <code>XIncludeParserConfiguration</code> doesn't meet your needs, then you'll
      have to write your own parser configuration. Make sure that this configuration
      includes a <code>org.apache.xerces.xinclude.XIncludeHandler</code>, and that the
      property &quot;http://apache.org/xml/properties/internal/namespace-context&quot; is an instance of
      <code>org.apache.xerces.xinclude.XIncludeNamespaceSupport</code>.  It is strongly
      recommended that the <code>XIncludeHandler</code> be placed in the pipeline
      before the Schema validator, if there is one.  PSVI information cannot be
      guaranteed to be valid after XInclude processing.
     </p>
    </a>
  </faq>

  <faq title="xml:base attributes and XML Schema validation">
    <q>Why are xml:base attributes added, which make Schema validation fail?</q>
    <a>
     <p>
      According to the specification for XInclude, processors must add an <code>xml:base</code>
      attribute to elements included from locations with a different base URI.  Without
      these attributes, the resulting infoset information would be incorrect.  Unfortunately,
      these attributes make XInclude processing not transparent to Schema validation.
     </p>
     <p>
      The solution to this is to modify your schema to allow <code>xml:base</code>
      attributes to appear on elements that might be included from different base URIs.
      If this solution is really unappealing to you, voice your concerns on the
      xerces-j-user mailing list.
     </p>
    </a>
  </faq>

  <faq title="XML Base Support">
    <q>Does the XInclude processor recognize xml:base attributes?</q>
    <a> 
     <p>
      Yes. The XInclude specification requires processors to use the base URI
      (as specified in the <jump href="http://www.w3.org/TR/xmlbase/">XML Base</jump>
      recommendation) to resolve relative IRIs to compute the
      <jump href="http://www.w3.org/TR/2003/WD-xinclude-20031110/#include-location">include location</jump>.
      Support for XML Base was added to the XInclude implementation in Xerces 2.6.0.
     </p>
    </a>
  </faq>
  
  <faq title="Document Fragments">
    <q>Why doesn't including document fragments work?</q>
    <a>
     <p>
      Currently, our implementation of XInclude is not fully complete, and we do
      not support <jump href="http://www.w3.org/TR/2003/WD-xinclude-20031110/#XPCore">XPointer</jump>
      references.  We hope that in the future we will have a
      fully compliant XInclude processor that can handle this feature.
     </p>
    </a>
  </faq>
  
  <faq title="Content Negotiation">
    <q>Are the values of the content negotiation attributes used in an HTTP request?</q>
    <a>
     <p>
      Currently, the values of the <code>accept</code>, <code>accept-charset</code> and
      <code>accept-language</code> attributes from an 
      <jump href="http://www.w3.org/TR/2003/WD-xinclude-20031110/#include_element">include</jump>
      element are only included in an HTTP request for included items when parse="text". We hope
      that in the future we will be able to support content negotiation for included items
      when parse="xml".
     </p>
    </a>
  </faq>
  
  <faq title="The Namespace: 'http://www.w3.org/2001/XInclude'">
    <q>Will the XInclude processor process include elements from the 'http://www.w3.org/2001/XInclude' namespace?</q>
    <a>
     <p>
      No. The namespace for XInclude was changed during development to 
      <code>http://www.w3.org/2003/XInclude</code>. The specification
      recommends that XInclude processors provide a diagnostic for include 
      elements in the old namespace. Xerces' XInclude processor will report 
      a warning.
     </p>
    </a>
  </faq>
 
</faqs>
