File: status.html

package info (click to toggle)
dom4j 1.6.1%2Bdfsg.2-4
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 34,224 kB
  • ctags: 67,911
  • sloc: xml: 29,667; java: 26,408; makefile: 55
file content (780 lines) | stat: -rw-r--r-- 60,699 bytes parent folder | download | duplicates (6)
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>dom4j - Change History</title><style type="text/css" media="all">
          @import url("./style/maven-base.css");
          
          @import url("./style/maven-theme.css");</style><link rel="stylesheet" href="./style/print.css" type="text/css" media="print"></link><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"></meta><meta name="author" content="James Strachan"></meta><meta name="email" content="jstrachan@apache.org"></meta></head><body class="composite"><div id="banner"><a href="http://sourceforge.net/projects/dom4j" id="organizationLogo"><img alt="MetaStuff Ltd." src="http://sourceforge.net/sflogo.php?group_id=16035"></img></a><a href="http://dom4j.org" id="projectLogo"><img alt="dom4j" src="./images/logo.gif"></img></a><div class="clear"><hr></hr></div></div><div id="breadcrumbs"><div class="xleft">
              Last published: 16 May 2005
              <span class="separator">|</span>
                Doc for 1.6.1
              </div><div class="xright">
        
        <a href="http://www.w3.org/TR/xpath" class="externalLink" title="External Link">XPath Spec</a>
      
        
          
            <span class="separator">|</span>
          
        
        <a href="http://jaxen.codehaus.org/" class="externalLink" title="External Link">Jaxen</a>
      
        
          
            <span class="separator">|</span>
          
        
        <a href="http://sourceforge.net/projects/dom4j/" class="externalLink" title="External Link">dom4j@SourceForge</a>
      </div><div class="clear"><hr></hr></div></div><div id="leftColumn"><div id="navcolumn"><div id="menudom4j"><h5>dom4j</h5><ul><li class="none"><a href="index.html">Home</a></li><li class="none"><a href="faq.html">FAQ</a></li><li class="none"><a href="guide.html">Quick start</a></li><li class="none"><a href="cookbook.html" class="newWindow" title="New Window" target="_blank">Cookbook</a></li><li class="none"><a href="compare.html">Comparison</a></li><li class="none"><a href="goals.html">Goals</a></li><li class="none"><a href="changes-report.html">Changes</a></li><li class="none"><a href="download.html">Download</a></li><li class="none"><a href="license.html">License</a></li><li class="none"><a href="apidocs/index.html" class="newWindow" title="New Window" target="_blank">Javadoc (1.6.1)</a></li><li class="none"><a href="http://www.dom4j.org/dom4j-1.5.2/apidocs/index.html" class="newWindow" title="New Window" target="_blank">Javadoc (1.5.2)</a></li><li class="none"><a href="http://www.dom4j.org/dom4j-1.4/apidocs/index.html" class="newWindow" title="New Window" target="_blank">Javadoc (1.4)</a></li></ul></div><div id="menuProject_Documentation"><h5>Project Documentation</h5><ul><li class="none"><a href="index.html">About dom4j</a></li><li class="collapsed"><a href="project-info.html">Project Info</a></li><li class="collapsed"><a href="maven-reports.html">Project Reports</a></li><li class="none"><a href="http://maven.apache.org/development-process.html" class="externalLink" title="External Link">Development Process</a></li></ul></div><div id="legend"><h5>Legend</h5><ul><li class="externalLink">External Link</li><li class="newWindow">Opens in a new window</li></ul></div><a href="http://www.cenqua.com/clover" title="Code Coverage by Clover" id="poweredByExternal"><img alt="Code Coverage by Clover" src="http://www.cenqua.com/images/clovered1.gif"></img></a><a href="http://www.sourceforge.net" title="Hosted by SourceForge" id="poweredByExternal"><img alt="Hosted by SourceForge" src="http://sourceforge.net/sflogo.php?group_id=16035&amp;amp;type=1"></img></a><a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy"><img alt="Built by Maven" src="./images/logos/maven-button-1.png"></img></a></div></div><div id="bodyColumn"><div class="contentBox"><div class="section"><a name="CVS"></a><h2>CVS</h2><p>Fixed bug in <code>BeanElement</code> which prevented proper execution of the bean samples (contributed by Wonne Keysers).</p><p><code>STAXEventWriter</code> now uses <code>XMLEventConsumer</code> instead of <code>XMLEventWriter</code> (contributed by Christian Niles).</p><p>Fixed bug in <code>SAXReader</code> that caused problems parsing files in OSX (reported by Paul Libbrecht).</p><p>Fixed bug in <code>XMLWriter</code> that caused whitespace to be added between successive calls of the <code>characters(...)</code> method (reported by Paul Libbrecht).</p><p>Improved performance of <code>NamespaceCache</code> in multithreaded environments (contributed by Brett Finnell).</p></div><div class="section"><a name="1_5_beta_2"></a><h2>1.5 beta 2</h2><p>Added flag to <code>OutputFormat</code> that supresses newline after XML declaration.</p><p>Upgraded dependencies to their latest version on ibiblio.</p><p>Added method to <code>DocumentHelper</code> that allows user to specify encoding when parsing an xml <code>String</code>
           (contributed by Todd Wolff).</p><p>Fixed a ClassCastException bug in <code>BeanElement</code>.</p><p>Fixed a bug in <code>SAXContentHandler</code> which caused a <code>NullPointerException</code> in some 
           situations.</p><p>Fixed bug which prevented an element's namespace prefix from being registered for use in xpath expressions (contributed by Todd Wolff).</p><p>Fixed bug in <code>XMLWriter</code> that caused duplication of the default namespace declaration (reported by Todd Wolff).</p><p>Added a bunch of patches to make the dom4j DOM classes more DOM compliant (contributed by Curt Arnold).</p><p>Fixed bug in <code>DispatchHandler</code> which made the handler not reusable (reported by Ricardo Leon).</p><p>Fixed bug in <code>SAXContentHandler</code> that caused incorrect CDATA section parsing (contributed by Todd Wolff).</p><p>Fixed bug in <code>SAXContentHandler</code> that caused incorrect entity handling.</p><p>Fixed bug in <code>XMLWriter</code> causing padding to be disabled, even if enabled in the specified outputformat (reported by Bo Gundersen).</p><p>Added initial support for STaX streams (contributed by Christian Niles).</p></div><div class="section"><a name="1_5_beta_1"></a><h2>1.5 beta 1</h2><p>Fixed encoding bug in <code>Document.asXML()</code> and <code>DocumentHelper.parseText()</code>.</p><p>Fixed bug in SAXReader that caused problems resolving relative URIs when parsing java.io.File Objects (reported by Kohsuke Kawaguchi).</p><p>The iterators returned by the Element.elementIterator(...) methods now support remove().</p><p>DOMWriter writes now DOM Level 2 attributes and elements (reported by Geert Dendoncker and Joury Gokel).</p><p>Use latest implementation of the Aelfred parser.</p><p>Fixed some problems with internal/external DTD declarations (reported by Bryan Thompson).</p><p>Upgraded to Jaxen 1.1 beta 2.</p><p>Ignore attribute order when comparing Elements in <code>NodeComparator</code>.</p><p>Fixed bug in XMLWriter where namespace declarations were duplicated.</p><p>Fixed bug in parsing a Processing Instruction (reported by Vladimir Kralik).</p><p>Added support for Stylesheet modes (reported by Mark Diggory).</p><p>Don't escape " and ' characters in attribute values if it's not necessary (contributed by Christian Niles).</p><p>Fixed some <code>DOMNodeHelper</code> issues (reported by Henner Kollmann).</p><p>Fixed some datatype issues (reported by Thomas Draier).</p><p>Fixed an bug where the EntityResolver was not set on the XMLReader.</p><p>Fixed multithreaded access on <code>DefaultElement</code>.</p><p>Fixed problem parsing XML Files (reported by Geoffrey Vlassaks).</p><p>Added xml:space attribute support based on XML Specification 1.0.</p><p>Maven build of dom4j is now nearly complete. Maven is now used for the website generation.</p><p>Fixed some bugs in BackedList (contributed by Alessandro Vernet).</p></div><div class="section"><a name="1_4_Release"></a><h2>1.4 Release</h2><p>Added patch supplied by Dan Jacobs that fixes some entity encoding problems in XMLWriter - cheers Dan!
        </p><p>Patched the DOMElement replaceChild method to return the correct Node and to throw a DOMException when trying to replace a non-existing child.
        </p><p>Added patch to BackedList that could cause IndexOutOfBoundsExceptions to be thrown
        	that was kindly supplied by Andy Yang - thanks Andy!	
        </p><p>Update of Cookbook containing a chapter about rule API.
        </p><p>Patched SAXWriter to not pass in null System or Public IDs which can cause problems in Saxon.
        </p><p>Patched dom4j to work against Jaxen 1.0 RC1 or later build.
        </p><p>Applied patch to bug found by Tom Oehser that XPath expressions using elements or attributes whose name starts 
        with '_' were not being handled correctly. It turns out this was a SAXPath issue.
        </p><p>Applied patch to bug found by Soumanjoy Das that creating a new DOMDocument then calling createElement() would generate
          a ClassCastException.
        </p><p>Applied patch supplied by James Dodd that fixes a MIME encoding issue in the embedded Aelfred parser
        </p><p>Applied patch to fix bug found by David Frankson. Adding attributes with null values causes problems in XSLT engines
            so now adding a null valued attribute is equivalent to removing the attribute. So null attribute values are silently ignored.
            e.g.
<pre>
Element element = ...;
element.addAttribute( "foo", "123" );
...
Attribute attribute = element.attribute( "foo" );
assertTrue( attribute != null );
...
element.addAttribute( "foo", null );
attribute = element.attribute( "foo" );
assertTrue( attribute == null );
</pre>
        </p></div><div class="section"><a name="1_3_Release"></a><h2>1.3 Release</h2><div class="section"><a name="Patches"></a><h2>Patches</h2><p>Applied patch to bug found by Mike Skells that was causing XPath.matches() to return true for absolute XPaths which returned different nodes to the node provided to the XPath.
        </p><p>Applied patch provided by Stefan that was causing IndexOutOfBoundsException when using the evaluate() method in DefaultXPath on an empty result set. Also added a test case to org.dom4j.TestXPathBug called testStefan().
        </p><p>Applied patch suggested by Frank Walinsky, that XPath objects are now Serializable. 
        </p><p>Applied patch provided by Bill Burton that fixes union pattern matching. 
        </p></div></div><div class="section"><a name="1_2_Release"></a><h2>1.2 Release</h2><div class="section"><a name="New_Swing_TableModel_for_displaying_XML"></a><h2>New Swing TableModel for displaying XML</h2><p>Added a new Swing TableModel for displaying XML data in a Swing user interface. It uses
          an XPath based model to define the rows and column values.
          A table definition can be specified using a simple XML format and then loaded in a small amount of code.
          e.g. here's an example of a table that will list the servlets used in a web.xml document
        </p><pre>
&lt;table select="/web-app/servlet"&gt;
  &lt;column select="servlet-name"&gt;Name&lt;/column&gt;
  &lt;column select="servlet-class"&gt;Class&lt;/column&gt;
  &lt;column select="../servlet-mapping[servlet-name=$Name]/url-pattern"&gt;Mapping&lt;/column&gt;
&lt;/table&gt;
</pre><p>
          Notice the use of the $Name XPath variable to access other cells on the row.
          Here's the pseudo code to display a table for an XML document.
          </p><pre>
Document tableDefinition = ...;
Document source = ...;
TableModel tableModel = new XMLTableModel( tableDefinition, source );
JTable table = new JTable( tableModel );
</pre><p>
          There is a sample program in samples/swing/JTableTool which will display any table definition
          for a given source XML document. There is an example table definition for the periodic table
          in xml/swing/tableForAtoms.xml.
        </p></div><div class="section"><a name="Registering_Namespace_URIs_for_XPath"></a><h2>Registering Namespace URIs for XPath</h2><p>Added a new helper method to make it easier to create namespace contexts for doing
          namespace aware XPath expressions. The new setNamespaceURIs(Map) method on XPath makes it easier
          to pass in the prefixes and URIs you wish to use in an XPath expression. Here's an example of it in action
        </p><pre>
Map uris = new HashMap();
uris.put( "SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/" );
uris.put( "m", "urn:xmethodsBabelFish" );        
XPath xpath = document.createXPath( "/SOAP-ENV:Envelope/SOAP-ENV:Body/m:BabelFish" );
xpath.setNamespaceURIs( uris );        
Node element = xpath.selectSingleNode( document );
</pre><p>In addition DocumentFactory has a setXPathNamespaceURIs(Map) method so that common namespace URIs can be associated with
          a DocumentFactory so namespace prefixes can be used across many XPath expressions in an easy way. e.g.
        </p><pre>
// register prefixes with my factory
Map uris = new HashMap();
uris.put( "SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/" );
uris.put( "m", "urn:xmethodsBabelFish" );        

DocumentFactory factory = new DocumentFactory();
factory.setXPathNamespaceURIs( uris );

// now parse a document using my factory
SAXReader reader = new SAXReader();
reader.setDocumentFactory( factory );
Document doc = reader.read( "soap.xml" );

// now lets use the prefixes
Node element = doc.selectSingleNode( "/SOAP-ENV:Envelope/SOAP-ENV:Body/m:BabelFish" );
</pre></div><div class="section"><a name="Whitespace_handling"></a><h2>Whitespace handling</h2><p>There is a new <i>mergeAdjacentText</i> option available on SAXReader 
        to concatenate adjacent text nodes into a single Text node. 
        </p><p>
        In addition there is a new <i>stripWhitespaceText</i> option to strip text which occurs between 
        start/end tags which only consists of whitespace. 
        </p><p>
        For example, parsing the following XML with the stripWhitespaceText option enabled
        and the mergeAdjacentText option enabled
        will result in a single child node of the parent element, rather than 3 (2 text nodes containing whitespace and one element).
        </p><pre>
&lt;parent&gt;
  &lt;child&gt;foo&lt;/child&gt;
&lt;/parent&gt;
</pre><p>
        Note that this option will not break most mixed content markup such as the following, 
        since its only whitespace between tag start/ends that gets removed; non-whitespace strings are not trimmed.
        </p><pre>
&lt;p&gt;hello &lt;b&gt;James&lt;/b&gt; how are you?&lt;/p&gt;
</pre><p>
        Both these options together can improve the parsing performance by around 10-12% depending on the 
        structure of the document. Though the whitespace layout of the XML document will be lost, so only
        use these modes in data-centric applications like XML messaging and SOAP.
        </p><p>
        So a typical SOAP or XML messaging developer, who may care more about performance than
        preserving exact whitespace layout, may use the following code to 
        make the SAX parsing more optimal.
        </p><pre>
SAXReader reader = new SAXReader();
reader.setMergeAdjacentText( true );
reader.setStripWhitespaceText( true );
Document doc = reader.read( "soap.xml" );
</pre></div><div class="section"><a name="Patches"></a><h2>Patches</h2><p>Applied patch to HTMLWriter to fix bug found by Dominik Deimling that was not correctly outputting CDATA sections correctly.
        </p><p>Patched the setName() method on Element so that elements can be renamed. Also added a new setQName() to the Element interface so that elements can be renamed in a namespace aware manner. Thanks to Robert Lebowitz for this.
        </p><p>Applied fix to bug found by Manfred Lotz that XMLWriter in whitespace trimming mode would sometimes not correctly insert a space when text is seperated by newlines. The Test case testWhitespaceBug() in org.dom4j.TestXMLWriter reproduces the bug that has now been fixed.
        </p><p>Applied patches supplied by Stefan Graeber that enhance the datatype support to support included schemata and derived element types.
        </p><p>Applied patches suggested by Omer van der Horst Jansen to enable dom4j to fully work
          properly on JDK1.1 platforms. There were some uses of java.util.Stack which have been changed to ArrayList.
        </p><p>Applied patches supplied by Maarten Coene that fixes some issues with using the correct
          DocumentFactory when using the DOM implementation.
        </p><p>Updated the MSV support to comply with the latest MSV version, 1.12 (Nov 01 2001).
          In addition the MSVDemo.java in dom4j/src/samples/validate has been replaced by
          JARVDemo.java which now uses the <a href="http://iso-relax.sourceforge.net/JARV/" class="externalLink" title="External Link">JARV</a> API 
          to validate a dom4j 
          document using the <a href="http://wwws.sun.com/software/xml/developers/multischema/index.html/" class="externalLink" title="External Link">MSV</a> implementation.
          This demo can validate any XML document against any DTD, XML Schema, Relax NG, Relax or Trex
          schema - thanks to the excellent JARV API and MSV library.
        </p><p>Applied patches supplied by Steen Lehmann that fixes handling of external DTD entities in SAXContentHandler 
          and fix the XML output of the ExternalEntityDecl
        </p><p>Applied patch to bug found by Steen Lehmann that XPath expressions on the root element
          were not correctly handling namespaces correctly. The test case is demonstrated in
          dom4j/src/test/org/dom4j/xpath/TestSelectSingleNode.java
        </p><p>Added patch found by Howard Moore when using XTags that XPath string values which contained
        strings with entities, such as the use of &amp;amp; in a text, would result in redundant spaces
        occuring, breaking URLs.
        </p></div></div><div class="section"><a name="1_1_Release"></a><h2>1.1 Release</h2><div class="section"><a name="New_features"></a><h2>New features</h2><p>Added a new package, org.dom4j.dtd which contains some DTD declaration classes which are added to the DocumentType interfaces
        List of declarations. This is useful for finding out details of the attribute or element delcarations inside either the 
        internal or external DTD subset of a document. 
        </p><p>To expand internal or external DTD subsets when parsing with SAXReader use the 2 properties on SAXReader (and SAXContentHandler). 
        </p><pre>
SAXReader reader = new SAXReader();
reader.setIncludeInternalDTDDeclarations( true );
reader.setIncludeExternalDTDDeclarations( true );
Document doc = reader.read( "foo.xml" );

DocumentType docType = doc.getDocType();
List internalDecls = docType.getInternalDeclarations();
List externalDecls = docType.getExternalDeclarations();
</pre><p>This new feature means that XML documents which use internal DTD subsets, external DTDs or a mixture of internal and external
        DTD subsets can now be properly round tripped.
        </p><p>Note that there appears to be a bug in Crimson 1.1.3 which does not properly differentiate between internal or external DTD 
        subsets. Refer to the <a href="http://dom4j.org/javadoc/org/xml/sax/ext/LexicalHandler.html#startDTD(java.lang.String,java.lang.String,java.lang.String)" class="externalLink" title="External Link">startDTD()</a>
        method of <a href="http://dom4j.org/javadoc/org/xml/sax/ext/LexicalHandler.html" class="externalLink" title="External Link">LexicalHandler</a>
        for details of how startEntity/endEntity is meant to demark external DTD subsets.
        </p><p>
        Its our intention to expand internal DTD subsets by default (so that documents can be properly round tripped by default)
        but require external DTD subsets to be explicitly enabled via the property on the SAXReader (or SAXContentHandler). 
        This bug in Crimson causes all DTD declarations to appear as internal DTD subsets, which both is a performance overhead
        and breaks round tripping of documents which just use external DTD declarations. So until this matter is resolved
        both internal and external declarations are not expanded by default.
        </p><p>
        Note that the code works perfectly against Xerces.
        </p></div><div class="section"><a name="Patches"></a><h2>Patches</h2><p>Applied patch submitted by Yuxin Ruan which fixes some issues with XML Schema Data Type support
        </p><p>Followed Dennis Sosnoski's suggestion, adding a null text String to an Element
          now throws an IllegalArgumentException.
          To ensure that the IllegalArgumentException is not thrown its advisable
          to check for null first. For example...
        </p><pre>
Element element = ...;
String text = ...;

// might throw IllegalArgumentException
// if text == null
element.addText( text );

// safer to do this
if ( text != null ) {
  element.addText( text );
}
</pre><p>Fixed problem found by Kesav Kumar Kolla whereby a deserialized Document could have problems if 
          new elements were attempted to be added. The problem was an issue with DocumentFactory not correctly
          deserializing itself properly.
        </p><p>Fixed problem found by David Hooker with Ant build file for the 
        binary and source distribution that was not including the manifest file
        in the distribution. 
        </p><p>Applied patch submitted by Lari Hotari that was causing the XMLWriter to fail when used as a 
        SAX XMLFilter or ContentHandler to turn SAX events into XML text. Thanks Lari!
        </p><p>Fixed bug found by Kohsuke Kawaguchi that there was a problem in XMLWriter during its serialization of
        a document which redeclared the default namespace prefix. It turned out to be a bug in
        org.dom4j.tree.NamespaceStack where redeclarations of namespace prefixes were not being handled properly
        during serialization. The test cases in org.dom4j.TestXMLWriter and org.dom4j.TestNamespaces have been improved
        to test these features more rigorously.
        </p><p>Fixed bug found by Toby
        that was causing a security exception in applets when using a DocumentFactory.
        </p><p>Implemented the suggestion by Kesav Kumar, that the detach() method now returns the node (this) so that moving 
        nodes from one part of a document to any another can now be one line of code. Here's an example of it in use.
        </p><pre>
Document doc1 = ...;
Document doc2; = ...;
Element destination = doc2.getRootElement();
Element source = doc1.selectSingleNode( "//foo[@style='bar']" );

// lets move the source to the destination
destination.add( source.detach() );
</pre><p>Added better checking in selectSingleNode() implementation so that XPath expressions which do not
          return a Node throw a meaningful exception (not ClassCastException) informing the user of
          why the XPath expression did not succeed.
        </p><p>Added patch found by Kesav Kumar that a document containing null Strings would cause a NullPointerException
          to be thrown if it was passed into SAXWriter (used by the JAXP - XSLT code). Now the SAXWriter will
          quietly ignore null Strings, as will XMLWriter.
        </p></div></div><div class="section"><a name="1_0_release"></a><h2>1.0 release</h2><div class="section"><a name="New_features"></a><h2>New features</h2><p>Added helper method setXMLFilter() to SAXReader making it easier to install SAX filters to filter or preprocess SAX events
          before a dom4j Document is created. Also added a new sample program called sax.FilterDemo that demonstrates how to use a SAX filter
          with dom4j.
          </p><p>
            Added full support for <a href="http://jaxen.org" class="externalLink" title="External Link">Jaxen</a> function, namespace and variable context interfaces.
            This allows the XPath engine to be fully customized. e.g.
<pre>
XPath xpath = document.createXPath( "//foo[@code='123']" );

// customize function, namespace and variable contexts
xpath.setFunctionContext( myFunctionContext );
xpath.setNamespaceContext( myNamespaceContext );
xpath.setVariableContext( myVariableContext );

List nodes = xpath.selectNodes( document );
</pre>
          </p><p>
            Added new helper class <code>org.dom4j.util.XMLErrorHandler</code> which 
            turns SAX ErrorHandler callbacks into XML that can then be output in a JAXM or SOAP message
            or styled via XSLT or whatever.
          </p><p>Added new helper method <code>DocumentHelper.makeElement(doc, "a/b/c")</code> which will
            navigate from a document or element to the given simple path, creating new elements along the way if need be.
            This allows elements to be found or created using a simple path expression mechansim.
          </p><p>Added helper method getQName(String qualifiedName) to Element so that easier element name matching can be done. Here are some examples of it in use.
<pre>
// find all elements with a local name of "foo" 
// in any namespace
List list = element.elements( "foo" );

// find all elements with a local name "foo" 
// and the default namespace URI
List list = element.elements( element.getQName( "foo" ) );

// find all elements which match the local name "foo" 
// and the namespace URI mapped to the "x" prefix
List list = element.elements( element.getQName( "x:foo" ) );
</pre>
          </p><p>
            Added helper method on <code>org.dom4j.DocumentFactory</code> called <code>getQNames</code>
            that returns a List of all the QNames that were used to parse the documents.
          </p><p>
            Added an EntityResolver property to SAXReader to make it easier to configure a specific EntityResolver.
          </p></div><div class="section"><a name="Patches"></a><h2>Patches</h2><p>Added patch so that patterns such as <code>@id='123'</code> and <code>name()='foo'</code> are now
            working properly again. Also patterns such as <code>not(@id='123')</code> work now too.
          </p><p>Patched the dynamic loading of classes to fix some ClassLoader issues found with some application servers.
          </p><p>Ported the data type support to work with the latest MSV library from Sun
          </p><p>Fixed bug spotted by Stefan Graeber that was causing a DocumentException to be thrown with Xerces
            when turning validation mode on.
          </p><p>Patched bug in QName which was using the qualified name rather than the local name along with the namespace URI
            to determine equality.
          </p><p>
            Added patch kindly supplied by Michal Palicka that SAXReader was passing in the wrong name for the SAX string-interning feature. Thanks Michal!
          </p><p>
            Fixed the behaviour of DocumentFactory.createXPathFilter() to use XPath filtering
            rather than XSLT style patterns. One of the major differences is that an XSLT pattern
            (used in the &lt;xsl:template match="pattern"/&gt; element in XSLT) works slightly 
            differently. An element &lt;foo&gt; would match an XSLT pattern "foo" whereas an
            element &lt;bar&gt; could match an XPath filter "foo" if it contained a child &lt;foo&gt; 
            element.
          </p><p>
            Patched the behaviour of Node.matches(String xpathExpression) so that it uses
            XPath filters now rather than XSLT patterns.
          </p><p>
            Patched bug in XRule implementation in org.dom4j.rule that was causing ordering problems
            when using stylesheets - the Rule precendence order was not being correctly used.
          </p><p>
            Backed out a previous patch added to 0.9 such that attributes with no namespace prefix are in
            no namespace. An attribute does not inherit the default namespace - the only way to put an attribute
            into a namespace is via a namespace prefix.
          </p><p>
            Patched XMLWriter to that a flush() is not required when using an OutputStream 
            and the various sub-document write() methods 
            are called such as write(Element), write(Attribute), write(Node), write(Namespace) etc.
          </p><p>
            Fixed bug in SAXReader that setEntityResolver() was not always behaving properly. 
            Also the default entity resolver used to locate XML Schemas seems to work properly now.
          </p><p>
            Moved the XML Schema Data Type supporting classes in org.dom4j.schema.Schema* to
            org.dom4j.datatype.Datatype*. This should avoid confusion and better describe the
            intent of the classes, to implement Data typing, rather than schema validation.
            We hope to use the <a href="http://www.sun.com/software/xml/developers/multischema/" class="externalLink" title="External Link">MSV</a> 
            library for all of our schema validation requirements.
          </p></div></div><div class="section"><a name="0_9_release"></a><h2>0.9 release</h2><div class="section"><a name="Full_support_for_the_Jaxen_XPath_engine"></a><h2>Full support for the Jaxen XPath engine</h2><p>The XPath engine in dom4j has been migrated to using <a href="http://jaxen.org" class="externalLink" title="External Link">Jaxen</a>.
              This single XPath engine can be plugged into any model such that Jaxen will support
              DOM, dom4j, EXML and JDOM. Hopefully we'll get Jaxen working on Java Beans too.
            </p><p>
              In general this will mean a much better, more compliant and more bug-free XPath
              engine for dom4j as it will be used extensively across XML object models.
            </p><p>
              Already numerous irregularities have been fixed in the XPath support in dom4j.
              We have donated the dom4j XPath test harness to Jaxen so that we now have a large
              rigorous test harness to ensure correct XPath behaviour - this test harness is run
              against all 4 current XML object models to ensure consistent behaviour and valid 
              XPath compliance.             
            </p><p>
              We are also in the process of migrating over our XPath extension functions as 
              well as adding additional XPath functions such as those defined in XSLT and XPointer.
            </p></div><div class="section"><a name="New_features"></a><h2>New features</h2><p>New class org.dom4j.io.XMLResult which is-a JAXP Result which uses the same
                org.dom4j.io.OutputFormat object to provide its formatting options 
                to allow XML output from JAXP (such as via XSLT) to be pretty printed.
            </p><p>XMLWriter now implements the SAX XMLFilter interface so that it can
              be added to a SAX parsing filter chain to output the XML being parsed in a simple way.
              Many thanks to Joseph Bowbeer for his help in this area.
            </p><p>Added setProperty() and setFeature() methods to SAXReader to allow
              the easy configuration of custom parser properties via SAXReader, such
              as being able to specify the location of schema or DTD resources.
            </p><p>Added new method OutputFormat.createCompactFormat() for those wishing
              to output their XML in a compact format, such as in messaging systems.
            </p></div><div class="section"><a name="Patches_and_bug_fixes"></a><h2>Patches and bug fixes</h2><p>Fixed bug in getNamespaceForPrefix() where if the prefix is null or ""
               and there is a default namespace defined, this method was returning 
               a namespace instance with the incorrect URI. 
            </p><p>Patched DOM writer so that it uses JAXP if it is available on the CLASSPATH
               using namespace aware mode by default.
            </p><p>Fixed a number of issues relating to namespaces and the redefinition of namespace prefixes.
              We now have a quite aggressive JUnit test harness to ensure that we handle namespace URIs
              correctly when prefixes are mapped and unmapped.
            </p><p>Applied patch from Andrew Wason for HTMLWriter to support the full
              HTML 4.01 DTD elements which do not require proper XML element closes.
              The new elements are PARAM, AREA, LINK, COL, BASE and META.
            </p><p>Fixed bug found by Dennis Sosnoski that SAX warnings were causing
              exceptions to be thrown by the SAXReader. Now warnings are silently ignored.
              If you want to detect warnings then an ErrorHandler should be registered with the
              SAXReader.
            </p><p>Patched bug that was also found by Jonathan Doughty for the non-standard
               behaviour of the FilterIterator. Also added Jonathan's JUnit test case
               to the distribution so that this problem should not come back. 
            </p><p>Fixed bug that when round tripping into JAXP and back again, sometimes
              additional namespace attributes were appearing.
              Now the TestRoundTrip JUnit test case includes JAXP round tripping.
            </p><p>Fixed bug that attributes without a namespace prefix which are inside
              an element with a default namespace declaration of the form xmlns="theURI", 
              the attribute now correctly inherits the namespace URI.
            </p><p>Applied patch found by Stefan Graeber that the UserDataFactory was not
              correctly creating UserDataAttribute instances.
            </p><p>Fixed bug that SAXWriter and DocumentSource were not correctly producing
            lexical events such as entities, comments and DOCTYPE declarations.
            Many thanks to Joseph Bowbeer for his help in this area.
            </p></div></div><div class="section"><a name="0_8_release"></a><h2>0.8 release</h2><div class="section"><a name="New_methods"></a><h2>New methods</h2><pre>hasContent()</pre><p> has been added to the Node interface
              so that it is easy to decide if a node is a leaf node or not.
              This method was suggested by Dane Foster.
              This method returns true if the node is a Branch (i.e. an Element or Document)
              which contains at least one node.
            </p><pre>getPath(Element context)</pre><pre>getUniquePath(Element context)</pre><p>These new methods 
              allow paths and unique paths to be created relatively. Previously both
              getPath() and getUniquePath() would create absolute XPath expressions. 
              These new methods allow relative path expressions to be created by providing
              an ancestor Element from which to make the path expression.
              This method was suggested by Chris Nokleberg.
            </p></div><div class="section"><a name="Patches_and_bug_fixes"></a><h2>Patches and bug fixes</h2><p>Fixed bug found by Chris Nokleberg when using the UserDataElement
               that the clone() and createCopy() methods were not correctly 
               copying the user data object. A JUnit test case has been added that
               tests this fix (org.dom4j.TestUserData).
               If any deep copying of user data objects is required then
               UserDataElement now has a method getCopyOfUserData()
               which can be overloaded to perform a deep copy of any user data
               objects if required.               
            </p><p>Minor patch for dom4j implementors wishing to create their own 
              QName implementations. Previously the DocumentFactory class was
              hardwired to use QNameCache internally which was hard wired to 
              only create QName instances.
              Now some factory methods have been added such that you can derive 
              your own DocumentFactory which uses your own
              QNameCache which creates your own QName classes.
            </p><p>If JAXP can be found in the CLASSPATH then it is now used first by
              the SAXReader to find the correct SAX parser class. 
              We have found that sometimes (e.g. Tomcat 4.0 beta 6) the value
              of the org.xml.sax.driver system property is set to a class which is not 
              in the CLASSPATH but a valid JAXP parser is present. 
              So now we try JAXP first, then the SAX system property then if all else fails
              we use the bundled Aelfred SAX parser.
            </p><p>Fixed XPath bug found by James Elson that the path /foo[@a and @b] or
              /foo[@a='1' and @b='2'] was no longer working correctly. This is now fixed
              and many tests of this nature have been added to the JUnit test harness.
            </p><p>Fixed some namespace related bugs found by Steen Lehmann.
              It appears that for a document of:-

           </p><pre>
&lt;a xmlns="dummyNamespace"&gt;
  &lt;b&gt;
    &lt;c&gt;Hello&lt;/c&gt;
  &lt;/b&gt;
&lt;/a&gt;
</pre><p>Then the path /a/b/c will not find anything - this is correct according to the XPath spec.
              Instead the path /*[name()='a']/*[name()='b']/*[name()='c'] is required.
              These changes have been applied to getPath() and getUniquePath() such that
              these methods now work, irrespectively of the namespaces used in a document.
              Finally many new test cases have been added to validate a variety of XPath
              expressions with various uses of namespaces.
            </p><p>SAXWriter now fully supports the SAX feature "http://xml.org/sax/features/namespace-prefixes".
              Failure to support this feature properly was causing problems
              when outputting a dom4j Document using JAXP - the namespace declarations often did not appear correctly.
            </p><p>Patched bug in XMLWriter which caused multiple duplicate namespace declarations to sometimes appear.
            </p></div></div><div class="section"><a name="0_7_release"></a><h2>0.7 release</h2><div class="section"><a name="Integration_with_SAXPath"></a><h2>Integration with SAXPath</h2><p>The <a href="http://saxpath.org" class="externalLink" title="External Link">SAXPath</a> project is a 
              Simple API for XPath parsing. Its analogous to
              SAX in that the API abstracts away the details of parsing XPath 
              expressions and provides a simple event based callback
              interface. 
             </p><p>
              Originally dom4j was using a parser generated via the <a href="http://antlr.org" class="externalLink" title="External Link">Antlr</a> tool
              which resulted in a considerably larger code base. 
              Now dom4j uses SAXPath for its XPath parsing which results in faster XPath parsing 
              and a much smaller code base. 
             </p><p>
              The dom4j.jar is now about 100 Kb smaller!
              Also several XPath related bugs are now fixed. For example the numeric paths like '2 + count(//foo)' are now working.              
             </p></div><div class="section"><a name="Patches_and_bug_fixes"></a><h2>Patches and bug fixes</h2><p>Fixed bug found by Tobias Rademacher that XML Schema Data Type support
            wasn't working correctly when the XSD document used a namespace prefix.
            The bug was hidden by a further bug in the JUnit test case that was not correctly
            testing this case. Both these bugs are now fixed.
            </p><p>Fixed bug found by Piero de Salvia that some invalid XPath expressions were not correctly
            throwing exceptions. Now any attempt to use any invalid XPath expressions should result
            in an 
              <a href="apidocs/org/dom4j/InvalidXPathException.html">InvalidXPathException</a>
            being thrown.
            </p><p>Applied patch submitted by Theodor Schwarzinger that fixes the preceding-sibling and preceding axes.
            </p><p>Fixed bug found my James Elson that the normalize() method was being quite agressive and removing 
              all text nodes! New JUnit test case added to ensure this doesn't break again.
            </p><p>Improved the setContent() semantics on Branch (and so Element and Document) such that the 
              parent and document relationships are correctly removed for old content and added for new content.
              As a helper method, the setContent() method will clone any content nodes which are already
              part of an existing document. So for example the following code will clone the content of a document.
<pre>
    Document doc1 = ...;
    Document doc2 = DocumentHelper.createDocument();  
    doc2.setContent( doc1.content() );
</pre>
              Though this behaviour is much more useful when used with elements...
<pre>
    Element sourceElement;
    Element destElement;

    // copy the content of sourceElemenet
    destElement.setContent( sourceElement.content() );
</pre>
            </p></div></div><div class="section"><a name="0_6_release"></a><h2>0.6 release</h2><div class="section"><a name="Serialization_support_added"></a><h2>Serialization support added</h2><p>Support has been added for Java Serialization so dom4j documents can be serialized over RMI or EJB calls.
            Note that currently Serialization is <i>much</i> slower (by a factor of 2-5 times) than using the textual format of
            XML so we recommend sending XML text over RMI rather than serialization if possible. Over time we will tune
            the serialization implementation to be at least as fast as using the text format (even if that means under the 
            covers we just use the text format).
            </p></div><div class="section"><a name="Patches_and_bug_fixes"></a><h2>Patches and bug fixes</h2><p>Fixed bug in XPath engine found by Christophe Ponsard
              for paths of the form /* which were not finding
              anything. Now we have an extensible XPath test harness (in src/test/org/dom4j/TestXPathExamples.java)
              which contains some test cases for these kinds of paths. We can extend these cases
              to test other XPath expressions easily.
            </p><p>Fixed bug in elementByID() method found by Thomas Nichols that was resulting in
              the element not being found correctly.
            </p><p>Fixed bug in IndexedElement reported by Kerstin Gr�nefeld that was causing
              a null pointer exception when using XPath on an IndexedElement.
            </p><p>Applied the patch supplied by Mike Skells that fix problems with the
              getUniquePath() method not returning properly indexed elements
            </p><p>Applied a fix to the problem found by Dane Foster when using dom4j with JTidy.
              JTidy returns null for getLocalName() so DOMReader has been patched to handle
              nulls returned from either getLocalName() or getName().
            </p><p>Fixed bug reported anonymously to the Sourceforge Site
              <a href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=436670&amp;group_id=16035&amp;atid=116035" class="externalLink" title="External Link">
              here
              </a>
              that explicitly creating a Document from an existing Element could cause problems when
              using XMLWriter.
            </p><p>Assorted performance tunings of SAX parsing, avoiding unnecessary repeated code paths.
            </p><p>Tidied factory and construction of Element code such that there are no longer
            dependencies on the SAX Attributes class. This was originally added as a performance
            enhancement, but after further refactoring this is now no longer needed.
            This makes the process of creating new Element derivations or DocumentFactory
            implementations easier.
            </p></div></div><div class="section"><a name="0_5_release"></a><h2>0.5 release</h2><div class="section"><a name="NodeComparator_available"></a><h2>NodeComparator available</h2><p>For those wishing to do value based comparisons of Nodes, 
              Element, Attributes, Documents or Document fragments
              there is a new 
              <a href="apidocs/org/dom4j/util/NodeComparator.html">NodeComparator</a>
              class which implements the 
              <a href="http://java.sun.com/j2se/1.3/docs/api/java/util/Comparator.html" class="externalLink" title="External Link">Comparator</a>
              interface from the Java Collections Framework.
            </p></div><div class="section"><a name="New_helper_method_DocumentHelper_parseText__"></a><h2>New helper method DocumentHelper.parseText()</h2><p>A new helper method has been added for parsing text.
              For example:-
            </p><pre>
    Document document = DocumentHelper.parseText(
        "&lt;team&gt; &lt;author&gt;James&lt;/author&gt; &lt;/team&gt;"
    );
</pre></div><div class="section"><a name="New_Branch_normalize___method"></a><h2>New Branch.normalize() method</h2><p>The Branch interface (and so Document and Element interfaces) has 
              a new normalize() method that has the same semantics as the same method 
              in the DOM API to remove empty Text nodes and merge adjacent Text nodes.
            </p></div><div class="section"><a name="Easier_document_building_methods"></a><h2>Easier document building methods</h2><p>A document can now be constructed more easily now that the addXXX() methods
              return a reference to the Document or Element which created them.
              An example is shown below
            </p><pre>
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;

public class Foo {

    public Document createDocument() {
        Document document = DocumentHelper.createDocument();
        Element root = document.addElement( "root" );

        Element author1 = root.addElement( "author" )
            .addAttribute( "name", "James" )
            .addAttribute( "location", "UK" )
            .addText( "James Strachan" );
        
        Element author2 = root.addElement( "author" )
            .addAttribute( "name", "Bob" )
            .addAttribute( "location", "Canada" )
            .addText( "Bob McWhirter" );

        return document;
    }
}
</pre><p>
              Note that the addElement() method returns the <b>new</b> child element
              not the parent element.
            </p><p>
              To promote consistency, the Element.setAttributeValue() method is now deprecated
              and should be replaced with Element.addAttribute().
            </p></div><div class="section"><a name="Patches_and_bug_fixes"></a><h2>Patches and bug fixes</h2><p>Applied Theo's patch for cloning of Documents correctly 
              together with JUnit test cases to ensure this keeps working.
            </p><p>Applied Rob Wilson's patch that NullPointerExceptions 
              were being thrown if a Document is output with the XMLWriter
              and an attribute value is null.
            </p><p>Fixed problem found by Nicolas Fonrose that XPath expressions
              using namespace prefixes were not working correcty.
            </p><p>Fixed problem found by Thomas Nichols whereby default namespaces
              with no prefix were not being processed correctly. 
              As a result of finding this bug we now have a rigorous JUnit round trip test 
              harness in place which highlighted a number of issues with namespaces when
              round tripping from dom4j to SAX to DOM to Text and back again.
              These issues have now been fixed and should not show up again hopefully.
            </p><p>Fixed some detach() bugs that were found with Attributes.
            </p><p>Default encoding is now "UTF-8" rather than "UTF8". Thanks to
              Thomas Nichols for spotting that one. Also the default 
              line seperator when using XMLWriter is now "\n" rather than "\r\n"
            </p><p>If an XMLWriter is used with an OutputStream then an explicit call to 
            flush() is no longer required after calling write(Document)
            </p><p>Some housekeeping was performed in the naming of some implementation classes.
              The old XPathXXX.java classes in the org.dom4j.tree package 
              where XXX = Attribute, CDATA, 
              Comment, Entity, ProcessingInstruction and Text have been renamed to
              DefaultXXX and the corresponding DefaultXXX has been renamed to
              FlyweightXXX. This makes it clearer the purpose of these implementation
              classes. The default implementations of the leaf nodes are mutable but cannot
              be shared across elements. The FlyweightXXX implementations are immutable
              and can be shared across nodes and documents.
            </p></div></div><div class="section"><a name="0_4_release"></a><h2>0.4 release</h2><div class="section"><a name="Enhanced_event_notification_mechanism"></a><h2>Enhanced event notification mechanism</h2><p>A new enhanced event notification mechanism has been implemented
              by David White.
              Now you can register multple
              <a href="apidocs/org/dom4j/ElementHandler.html">ElementHandler</a>
              instances with a 
              <a href="apidocs/org/dom4j/io/SAXReader.html">SAXReader</a>
              object before you parse a document such that the different
              handlers are notified when different paths are reached.
            </p><p>
              The <a href="apidocs/org/dom4j/ElementHandler.html">ElementHandler</a>
              interface now has both <code>onStart()</code> and <code>onEnd()</code>
              allowing more fine grained control over when you are called
              and the ability to perform actions before or after the content
              for an Element is populated.
              The methods also take a reference to a 
              <a href="apidocs/org/dom4j/ElementPath.html">ElementPath</a>
              to allow more optimised and powerful access to the path to the specified document.
            </p></div><div class="section"><a name="Early_alpha_release_of_XML_Schema_Data_Type_support"></a><h2>Early alpha release of XML Schema Data Type support</h2><p>This release contains an alpha release of XML Schema Data Type
            support.  
            The main class in question is the XML Schema Data Type aware
            <a href="apidocs/org/dom4j/datatype/DatatypeDocumentFactory.html">DatatypeDocumentFactory</a>            
            which will create an XML Schema Data Type aware XML object model.
            </p><p>
              The <code>getData()</code> and <code>setData(Object)</code> methods
              on 
              <a href="apidocs/org/dom4j/Attribute.html">Attribute</a> and            
              <a href="apidocs/org/dom4j/Element.html">Element</a>            
              allow access to the concrete data types such as Dates and Numbers.
            </p></div><div class="section"><a name="Patches_and_bug_fixes"></a><h2>Patches and bug fixes</h2><p>Applied Theo's patch for the XPath <code>substring</code> function 
              that was causing the incorrect string indexes to be returned.
              The <code>substring</code> now returns the correct answer.
            </p><p>Applied Theo's patch for incorrectly escaping of element text.
            </p><p>Fixed bug in the XPath engine for absolute path expressions which 
              now work correctly when applied to leaf nodes.
            </p><p>Fixed bug
              in the <code>name()</code> and <code>local-name()</code> 
              functions such that the following expressions now work fine
              <code>local-name(..), name(parent::*)</code>.
            </p></div><p>A variety of minor performance tuning optimisations have been made.
          </p></div><div class="section"><a name="0_3_release"></a><h2>0.3 release</h2><p>The <code>org.dom4j.io.OutputFormat</code> class now has a new helper
            method to make it easier to create pretty print formatting objects.
            The new method is <code>OutputFormat.createPrettyPrint()</code>.
            So to pretty print some XML (trimming all whitespace and indenting nicely)
            the following code should do the job...
          </p><pre>
    OutputFormat format = OutputFormat.createPrettyPrint();
    XMLWriter writer = new XMLWriter( out, format );
    writer.write( document );
    writer.close();
</pre><p><code>SAXReader.read(String url)</code> can now accept either 
            a URL or a file name which makes things a little easier.
            The logic uses the existence of a ':' in the url String to determine if
            it should be treated as a URL or a File name. 
          </p><p>For more explicit control over whether documents are Files or URLs
            call <code>SAXReader.read(File file)</code> or <code>SAXReader.read(URL url)</code>
          </p><p>A new extension function, <i>matrix-concat()</i> was submitted by 
          James Pereira.
          By default, doing <i>concat()</i> functions in XPath the 'string-value' is taken
          for each argument.
          So for a document:-</p><pre>
&lt;root project="dom4j"&gt;
    &lt;contributor&gt;James Pereira&lt;/contributor&gt;
    &lt;contributor&gt;Bob McWhirter&lt;/contributor&gt;
&lt;/root;&gt;
</pre><p>Then the XPath</p><pre>
concat( 'thanks ', /root/contributor )
</pre><p>would return</p><pre>
"thanks James Pereira"
</pre><p>as the <i>/root/contributor</i> expression matches a node set of 2 
      elements, but the "string-value" takes the first elements text.
      Whereas <i>matrix-contact</i> will do a cartesian product of all the 
      arguments and then do the concatenation of each combination of nodes. So
      </p><pre>
matrix-concat( 'thanks ', /root/contributor )
</pre><p>will produce</p><pre>
"thanks James Pereira"
"thanks Bob McWhirter"
</pre><p>The cartesian product is done such that multiple paths can be used.
      </p><pre>
matrix-concat( 'thanks ', /root/contributor, ' for working on ', '/@project' )
</pre><p>will produce</p><pre>
"thanks James Pereira for working on dom4j"
"thanks Bob McWhirter for working on dom4j"
</pre><p>Fixed bug where <code>XMLWriter.write(Object)</code> was not correctly
        writing a Document instance.
      </p><p>Finally, a couple of small issues with the build process have been fixed.
      The dom4j.jar no longer contains any SAX or DOM classes (they are all in dom4j-full.jar)
      And the Antlr grammar files for the XPath parser are now corrrectly 
      included in the binary  distribution.
      </p></div><div class="section"><a name="0_2_release"></a><h2>0.2 release</h2><p>There following new features were added:-
          </p><ul>
            <li>Clean integration with XSLT via JAXP / TrAX API.
            </li>
            <li>New SAXValidator to allow validation on prebuild Document instances
            </li>
            <li>XMLWriter and HTMLWriter rewritten so that they work at either 
                the SAX level or the dom4j level. 
                API much improved and more like Reader and Writer in the JDK.
            </li>
            <li>API modified to avoid clashes with WC3 DOM such that a dual 
                implementation of dom4j and DOM is now possible. An early alpha
                release of a DOM implementation of dom4j is available.
            </li>
            <li>New sorting method added to Node for easier selections of nodes
              which are sorted via an XPath expression. The following
              code sorts all CUSTOMER elements by their name attributes and 
              removes duplicates:-
              <pre>
Document document 
  = new SAXReader().read( new File( "customers.xml" ) );

List customers 
  = document.selectNodes( "//CUSTOMER", "@name", true );
              </pre>
            </li>
            <li>The getText() and getStringValue() methods of Element now return
              the textual values of CDATA, Entity and Text nodes. 
              The previous version only returned Text node values.
            </li>
            <li>Refactored code and removed XPathEngine, XPathHelper and 
                all the static newXXX() methods in DocumentFactory.
                Added equivalent methods to DocumentHelper and DocumentFactory.
            </li>
          </ul><p>This release also includes full XPath source code.
          </p></div><div class="section"><a name="0_1_release"></a><h2>0.1 release</h2><p>Initial release which comes complete with DOM, JAXP and SAX 
            support and integrated XPath
          </p></div><div class="section"><a name="To_Do_List"></a><h2>To Do List</h2><ul>
        <li>The internal subset does not pass through DOMReader and DOMWriter. This needs patching!
        </li>
        <li>We should add support for Xerces XNI API via an XNIReader and XNIWriter. This would also allow
          dom4j users to make good use of the NekoHTML parser thats layered on top of XNI.
        </li>
        <li>Better documentation and user guides
        </li>
        <li>A lazy parser; implement a special Element implementation (or probably a special List)
          which allows the XPP (XML Pull Parser) to parse the document as it is navigated rather than
          all up front.
        </li>
        <li>Build a dom4j validator based on top of Suns MSV library
        </li>
        <li>Ensure that the optional DOM implementation passes the DOM compliance tests
        </li>
        <li>Implement a ValidatingDocumentFactory and an EncodingDocumentFactory
          which can be used by developers where invalid strings may be specified
          allowing validation or encoding of names or text values to be
          done in one place for use across parsers or application code.
          This would avoid any performance hit by making this kind of validation 
          the default behaviour.
        </li>
        <li>Implement a canonical XML processor
        </li>
        <li>Implement XML Signature
        </li>
        <li>Implement XPointer, XLink and XInclude
        </li>
        <li>Build a version of XMLC which uses the dom4j API rather than DOM which
          could also make use of XPath, XSLT and Java 2 Collections support.
        </li>
        <li>
          Consider adding support for 
          <a href="http://developer.java.sun.com/developer/earlyAccess/adding_generics/" class="externalLink" title="External Link">Java Generics</a> 
          such that typesafe Iterators can be used. For example
          <pre>
Iterator&lt;Node&gt; iter = element.nodeIterator();
while ( iter.hasNext() ) {
    Node node = iter.next();
}

Iterator&lt;Element&gt; iter2 = element.elementIterator( "foo" );
while ( iter2.hasNext() ) {
    Element foo = iter2.next();
}
          </pre>
        </li>
        <li>Implement XSLT engine on top of <i>dom4j</i>?
        </li>
        <li>XML Query implementation on top of <i>dom4j</i>?
        </li>
      </ul></div><div class="section"><a name="Known_problems"></a><h2>Known problems</h2><p>The following functions are not yet fully supported in the inbuilt
        XPath engine</p><ul>
        <li>id()</li>
        <li>generate-id()</li>
        <li>format-number()</li>
      </ul><p>The optional W3C DOM implementation of the dom4j API is not yet at 
      full DOM compliance</p></div><div class="section"><a name="Contributors"></a><h2>Contributors</h2><p>The following people have contributed to the dom4j project. 
      Many thanks to you all!</p><ul>
        <li>James Strachan</li>
        <li>Bob McWhirter</li>
        <li>James Dodd</li>
        <li>James Elson</li>
        <li>Jakob Jenkov</li>
        <li>James Pereira</li>
        <li>David White</li>
        <li>Tobias Rademacher</li>
        <li>Rashmi Mathew</li>
        <li>Jonathan Doughty</li>
        <li>Joseph Bowbeer</li>
        <li>Michal Palicka</li>
        <li>Yuxin Ruan</li>
        <li>Steen Lehmann</li>
        <li>Maarten Coene</li>
        <li>Stefan Graeber</li>
      </ul></div></div></div><div class="clear"><hr></hr></div><div id="footer"><div class="xright"> 2001-2005, MetaStuff Ltd.</div><div class="clear"><hr></hr></div></div></body></html>