Author: veithen
Date: Sun Dec 21 15:25:06 2008
New Revision: 728550
URL: http://svn.apache.org/viewvc?rev=728550&view=rev
Log:
Implemented some more DOM methods. This should be sufficient to use DOOM
documents with XMLUnit.
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java
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/AttrImpl.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java?rev=728550&r1=728549&r2=728550&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java
Sun Dec 21 15:25:06 2008
@@ -166,8 +166,8 @@
}
public boolean getSpecified() {
- // TODO
- throw new UnsupportedOperationException("TODO");
+ // Since we don't support DTD or schema, we always return true
+ return true;
}
/**
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=728550&r1=728549&r2=728550&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
Sun Dec 21 15:25:06 2008
@@ -51,6 +51,7 @@
import java.io.OutputStream;
import java.util.Enumeration;
import java.util.Hashtable;
+import java.util.Iterator;
import java.util.Vector;
public class DocumentImpl extends ParentNode implements Document, OMDocument {
@@ -231,8 +232,17 @@
}
public DocumentType getDoctype() {
- // TODO
- throw new UnsupportedOperationException("TODO");
+ Iterator it = getChildren();
+ while (it.hasNext()) {
+ Object child = it.next();
+ if (child instanceof DocumentType) {
+ return (DocumentType)child;
+ } else if (child instanceof Element) {
+ // A doctype declaration can only appear before the root
element. Stop here.
+ return null;
+ }
+ }
+ return null;
}
public Element getElementById(String elementId) {