Author: veithen
Date: Sat Dec 6 14:34:40 2008
New Revision: 724046
URL: http://svn.apache.org/viewvc?rev=724046&view=rev
Log:
WSCOMMONS-254: DocumentImpl#getOMDocumentElement() made the incorrect
assumption that only an element can be the first child of a Document. This is
incorrect. There can be DTDs, comments and processing instructions before the
document element. Replaced the if statement by a while loop to fix this.
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java?rev=724046&r1=724045&r2=724046&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
Sat Dec 6 14:34:40 2008
@@ -438,8 +438,7 @@
*/
public OMElement getOMDocumentElement() {
- //We'r sure that only an element can be the first child of a Document
- if (this.documentElement == null && !this.done) {
+ while (this.documentElement == null && !this.done) {
this.builder.next();
}
return this.documentElement;