File: faq-xinclude.xml

package info (click to toggle)
libxerces2-java 2.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 12,596 kB
  • sloc: java: 127,777; xml: 13,728; sh: 39; makefile: 10
file content (171 lines) | stat: -rw-r--r-- 7,684 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?xml version='1.0' encoding='UTF-8'?>
<!--
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
-->
<!DOCTYPE faqs SYSTEM 'dtd/faqs.dtd'>
<faqs title='Using XInclude'>

  <faq title="Usage">
    <q>How do I enable XInclude processing?</q>
    <a>
     <p>
      Applications using JAXP 1.3 (and above) can enable XInclude processing 
      by setting XInclude awareness on the parser factory. The following 
      demonstrates how to accomplish this with SAX:
     </p>
     <source>import javax.xml.parsers.SAXParserFactory;
     
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setNamespaceAware(true);
spf.setXIncludeAware(true);
...  
</source>
     <p>
      You can also enable XInclude processing by turning on the 
      <link idref='features' anchor="xinclude">XInclude feature</link>.
     </p>
    </a>
  </faq>
  
  <faq title="XInclude and validation">
   <q>How do the validation features interact with XInclude processing?</q>
   <a>
    <p>
     If the <link idref='features' anchor="validation">validation feature</link>
     is turned on then DTD validation will be performed on each source document
     (to the XInclude processor) against their respective DTDs.
    </p>
    <p>
     If both the <link idref='features' anchor="validation">validation feature</link>
     and the <link idref='features' anchor="validation.schema">schema validation
     feature</link> are turned on then schema validation will be performed on the
     result infoset generated by the XInclude processor. DTD validation will be
     performed on each source document which contains a DTD. No DTD validation errors
     will be reported for source documents which have no DTD.
    </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>
      One 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.
      There is a similar problem with <code>xml:lang</code> attributes that are added as a result
      of language fixup. If the addition of <code>xml:base</code> and/or <code>xml:lang</code>
      is undesired by your application, you can disable
      <link idref='features' anchor='xinclude.fixup-base-uris'>base URI fixup</link> and 
      <link idref='features' anchor='xinclude.fixup-language'>language fixup</link> so that
      these attributes will not be added.
     </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/2006/REC-xinclude-20061115/#include-location">include location</jump>.
      Support for XML Base was added to the XInclude implementation in Xerces-J 2.6.0.
     </p>
    </a>
  </faq>
  
  <faq title="Language Fixup">
    <q>Does the XInclude processor perform language fixup?</q>
    <a>
     <p>
      Yes. The XInclude processor will preserve language information on a top-level included element
      by adding an <code>xml:lang</code> attribute if its include parent has a different [language]
      property. Support for language fixup was added to the XInclude implementation in Xerces-J 2.7.0.
     </p>
    </a>
  </faq>
  
  <faq title="References Property Fixup">
    <q>Does the XInclude processor perform references property fixup?</q>
    <a>
     <p>
      Section <jump href="http://www.w3.org/TR/2006/REC-xinclude-20061115/#references-property">4.5.3</jump>
      of the XInclude 1.0 W3C Recommendation describes fixup of the [references] property 
      of an attribute information item. For IDREF/IDREFS the property contains an ordered
      list of element information items. Xerces provides no mechanism for accessing this 
      property nor does it keep an internal representation. It should be noted that neither 
      the SAX or DOM APIs have native support for the [references] property. For Xerces, 
      references property fixup is a no-op.
     </p>
    </a>
  </faq>
  
  <faq title="Document Fragments">
    <q>Does the XInclude processor support XPointer?</q>
    <a>
     <p>
      Yes. The XInclude processor supports the 
      <jump href="http://www.w3.org/TR/2003/REC-xptr-framework-20030325/">XPointer Framework</jump>
      and the
      <jump href="http://www.w3.org/TR/2003/REC-xptr-element-20030325/">XPointer element() Scheme</jump>.
      The XPointer xpointer() Scheme is currently not supported.
     </p>
    </a>
  </faq>
  
  <faq title="XPointer and IDs">
    <q>What types of IDs are currently supported for XPointers?</q>
    <a>
     <p>
      For shorthand pointers and element() XPointers, currently only 
      <jump href="http://www.w3.org/TR/xptr-framework/#term-ddi">DTD-determined ID</jump>s
      are supported. <jump href="http://www.w3.org/TR/xptr-framework/#term-sdi">schema-determined ID</jump>s
      may be supported in a future release.
     </p>
    </a>
  </faq>
  
  <faq title="Content Negotiation">
    <q>Are the values of the content negotiation attributes used in an HTTP request?</q>
    <a>
     <p>
      Yes, the values of the <code>accept</code> and <code>accept-language</code> attributes 
      from an <jump href="http://www.w3.org/TR/2006/REC-xinclude-20061115/#include_element">include</jump>
      element are included as request properties in an HTTP request. Support for content negotiation 
      when parse="xml" was added to the XInclude implementation in Xerces-J 2.7.0.
     </p>
    </a>
  </faq>
  
  <faq title="The Namespace: 'http://www.w3.org/2003/XInclude'">
    <q>Will the XInclude processor process include elements from the 'http://www.w3.org/2003/XInclude' namespace?</q>
    <a>
     <p>
      No. The namespace for XInclude was changed back to <code>http://www.w3.org/2001/XInclude</code>
      in the <jump href="http://www.w3.org/TR/2004/CR-xinclude-20040413/">Candidate Recommendation (April 2004)</jump>.
      The <code>http://www.w3.org/2003/XInclude</code> namespace is no longer recognized.
     </p>
    </a>
  </faq>
 
</faqs>