Author: veithen
Date: Wed Mar 7 14:37:24 2012
New Revision: 1297980
URL: http://svn.apache.org/viewvc?rev=1297980&view=rev
Log:
Restrict access to NodeImpl#ownerNode so that we can easily change the way the
owner document and parent node are stored.
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttributeMap.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/CDATASectionImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPFaultTextImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttributeMap.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttributeMap.java?rev=1297980&r1=1297979&r2=1297980&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttributeMap.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttributeMap.java
Wed Mar 7 14:37:24 2012
@@ -150,7 +150,7 @@ public class AttributeMap extends NamedN
// same element
}
//Set the owner node
- attr.ownerNode = (DocumentImpl) this.ownerNode.getOwnerDocument();
+ attr.setOwnerDocument(ownerNode.ownerDocument());
attr.parent = this.ownerNode;
attr.isOwned(true); // To indicate that this attr belong to an element
@@ -160,8 +160,7 @@ public class AttributeMap extends NamedN
if (i >= 0) {
previous = (AttrImpl) nodes.elementAt(i);
nodes.setElementAt(attr, i);
- previous.ownerNode = (DocumentImpl) this.ownerNode
- .getOwnerDocument();
+ previous.setOwnerDocument(ownerNode.ownerDocument());
previous.parent = null;
previous.isOwned(false);
// make sure it won't be mistaken with defaults in case it's reused
@@ -217,8 +216,7 @@ public class AttributeMap extends NamedN
NodeImpl clone = (NodeImpl) n.cloneNode(true);
clone.isSpecified(n.isSpecified());
nodes.setElementAt(clone, i);
- clone.ownerNode = this.ownerNode.ownerNode;
- clone.isOwned(true);
+ clone.setOwnerDocument(ownerNode.ownerDocument());
}
}
}
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/CDATASectionImpl.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/CDATASectionImpl.java?rev=1297980&r1=1297979&r2=1297980&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/CDATASectionImpl.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/CDATASectionImpl.java
Wed Mar 7 14:37:24 2012
@@ -46,7 +46,7 @@ public class CDATASectionImpl extends Te
public Node cloneNode(boolean deep) {
CDATASectionImpl textImpl = new CDATASectionImpl(this.textValue,
this.factory);
- textImpl.setOwnerDocument(this.ownerNode);
+ textImpl.setOwnerDocument(ownerDocument());
return textImpl;
}
}
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java?rev=1297980&r1=1297979&r2=1297980&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
Wed Mar 7 14:37:24 2012
@@ -151,8 +151,7 @@ public class ElementImpl extends ParentN
OMXMLParserWrapper builder, OMFactory factory) {
this(tagName, ns, builder, factory);
if (parentNode != null) {
- this.ownerNode = (DocumentImpl) parentNode.getOwnerDocument();
- this.isOwned(true);
+ setOwnerDocument(parentNode.ownerDocument());
parentNode.addChild(this);
}
@@ -171,7 +170,7 @@ public class ElementImpl extends ParentN
public ElementImpl(OMFactory factory) {
super(factory);
- this.ownerNode = ((OMDOMFactory) factory).getDocument();
+ setOwnerDocument(((OMDOMFactory) factory).getDocument());
}
private OMNamespace handleNamespace(OMNamespace ns) {
@@ -420,7 +419,7 @@ public class ElementImpl extends ParentN
OMNamespace ns = this.findNamespaceURI(localName);
String nsuri = ns != null ? ns.getNamespaceURI() : "";
- AttrImpl namespaceAttr = new AttrImpl(this.ownerNode,
+ AttrImpl namespaceAttr = new AttrImpl(ownerDocument(),
localName, nsuri,
this.factory);
OMNamespaceImpl xmlNs = new
OMNamespaceImpl(OMConstants.XMLNS_NS_URI, null);
namespaceAttr.setOMNamespace(xmlNs);
@@ -505,7 +504,7 @@ public class ElementImpl extends ParentN
} else if (name.equals(OMConstants.XMLNS_NS_PREFIX)) {
this.declareDefaultNamespace(value);
} else {
- this.setAttributeNode(new AttrImpl(this.ownerNode, name, value,
+ this.setAttributeNode(new AttrImpl(ownerDocument(), name, value,
this.factory));
}
@@ -583,7 +582,7 @@ public class ElementImpl extends ParentN
this.declareNamespace(value, DOMUtil
.getLocalName(qualifiedName));
} else {
- AttrImpl attr = new AttrImpl(this.ownerNode, DOMUtil
+ AttrImpl attr = new AttrImpl(ownerDocument(), DOMUtil
.getLocalName(qualifiedName), value, this.factory);
attr.setOMNamespace(new OMNamespaceImpl(namespaceURI, DOMUtil
.getPrefix(qualifiedName)));
@@ -754,7 +753,7 @@ public class ElementImpl extends ParentN
}
}
}
- return addAttribute(new AttrImpl(ownerNode, localName, ns, value,
factory));
+ return addAttribute(new AttrImpl(ownerDocument(), localName, ns,
value, factory));
}
public OMNamespace addNamespaceDeclaration(String uri, String prefix) {
@@ -1086,7 +1085,7 @@ public class ElementImpl extends ParentN
child = child.getNextOMSibling();
}
- TextImpl textNode = (TextImpl) (this.ownerNode)
+ TextImpl textNode = (TextImpl)ownerDocument()
.createTextNode(text);
this.addChild(textNode);
}
@@ -1259,11 +1258,11 @@ public class ElementImpl extends ParentN
OMNamespace ns = (OMNamespace)this.namespaces.get(prefix);
if ("".equals(prefix)) {
- AttrImpl attr = new AttrImpl(this.ownerNode, "xmlns",
ns.getNamespaceURI(), this.factory);
+ AttrImpl attr = new AttrImpl(ownerDocument(), "xmlns",
ns.getNamespaceURI(), this.factory);
attr.setOMNamespace(XMLNS_NAMESPACE_WITHOUT_PREFIX);
attributeMap.addItem(attr);
} else {
- AttrImpl attr = new AttrImpl(this.ownerNode, prefix,
ns.getNamespaceURI(), this.factory);
+ AttrImpl attr = new AttrImpl(ownerDocument(), prefix,
ns.getNamespaceURI(), this.factory);
attr.setOMNamespace(XMLNS_NAMESPACE_WITH_PREFIX);
attributeMap.addItem(attr);
}
@@ -1406,9 +1405,9 @@ public class ElementImpl extends ParentN
private void updateIsId(boolean isId, AttrImpl tempAttr) {
tempAttr.isId = isId;
if (isId) {
- this.ownerNode.addIdAttr(tempAttr);
+ ownerDocument().addIdAttr(tempAttr);
} else {
- this.ownerNode.removeIdAttr(tempAttr);
+ ownerDocument().removeIdAttr(tempAttr);
}
}
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java?rev=1297980&r1=1297979&r2=1297980&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
Wed Mar 7 14:37:24 2012
@@ -41,7 +41,7 @@ public abstract class NodeImpl implement
/** Field done */
protected boolean done = false;
- protected DocumentImpl ownerNode;
+ private DocumentImpl ownerNode;
/** Factory that created this node */
protected final OMFactory factory;
@@ -67,7 +67,7 @@ public abstract class NodeImpl implement
protected NodeImpl(DocumentImpl ownerDocument, OMFactory factory) {
//this(factory);
this.factory = factory;
- this.ownerNode = ownerDocument;
+ setOwnerDocument(ownerDocument);
// this.isOwned(true);
}
@@ -126,7 +126,7 @@ public abstract class NodeImpl implement
* created). The Node may or may not
*/
public Document getOwnerDocument() {
- return this.ownerNode;
+ return ownerDocument();
}
/**
@@ -189,7 +189,7 @@ public abstract class NodeImpl implement
} catch (CloneNotSupportedException e) {
throw new RuntimeException("**Internal Error**" + e);
}
- newnode.ownerNode = this.ownerNode;
+ newnode.setOwnerDocument(ownerDocument());
newnode.isOwned(false);
newnode.isReadonly(false);
@@ -329,20 +329,23 @@ public abstract class NodeImpl implement
final void isNormalized(boolean value) {
// See if flag should propagate to parent.
- if (!value && isNormalized() && ownerNode != null) {
- ownerNode.isNormalized(false);
+ if (!value && isNormalized() && ownerDocument() != null) {
+ ownerDocument().isNormalized(false);
}
flags = (short) (value ? flags | NORMALIZED : flags & ~NORMALIZED);
}
+ DocumentImpl ownerDocument() {
+ return ownerNode;
+ }
+
/**
* Sets the owner document.
*
* @param document
*/
- protected void setOwnerDocument(DocumentImpl document) {
+ void setOwnerDocument(DocumentImpl document) {
this.ownerNode = document;
- this.isOwned(true);
}
/*
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java?rev=1297980&r1=1297979&r2=1297980&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
Wed Mar 7 14:37:24 2012
@@ -79,8 +79,8 @@ public abstract class ParentNode extends
public void addChild(OMNode omNode) {
if (omNode.getOMFactory() instanceof OMDOMFactory) {
Node domNode = (Node) omNode;
- if (this.ownerNode != null &&
!domNode.getOwnerDocument().equals(this.ownerNode)) {
- this.appendChild(this.ownerNode.importNode(domNode, true));
+ if (ownerDocument() != null &&
!domNode.getOwnerDocument().equals(ownerDocument())) {
+ this.appendChild(ownerDocument().importNode(domNode, true));
} else {
this.appendChild(domNode);
}
@@ -219,13 +219,13 @@ public abstract class ParentNode extends
DOMException.HIERARCHY_REQUEST_ERR,
null));
}
- if (newDomChild.parentNode() != null && newDomChild.ownerNode ==
this.ownerNode) {
+ if (newDomChild.parentNode() != null && newDomChild.ownerDocument() ==
ownerDocument()) {
//If the newChild is already in the tree remove it
newDomChild.parentNode().removeChild(newDomChild);
}
if (!(this instanceof Document)
- && !(this.ownerNode == newDomChild.getOwnerDocument())) {
+ && !(ownerDocument() == newDomChild.getOwnerDocument())) {
throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
DOMMessageFormatter.formatMessage(
DOMMessageFormatter.DOM_DOMAIN,
@@ -396,9 +396,9 @@ public abstract class ParentNode extends
if (newDomChild != null &&
//This is the case where this is an Element in the document
- (this.ownerNode != null &&
!this.ownerNode.equals(newDomChild.ownerNode)) ||
+ (ownerDocument() != null &&
!ownerDocument().equals(newDomChild.ownerDocument())) ||
//This is the case where this is the Document itself
- (this.ownerNode == null &&
!this.equals(newDomChild.ownerNode))) {
+ (ownerDocument() == null && !this.equals(ownerDocument()))) {
throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
DOMMessageFormatter.formatMessage(
DOMMessageFormatter.DOM_DOMAIN,
@@ -514,7 +514,7 @@ public abstract class ParentNode extends
ParentNode newnode = (ParentNode) super.cloneNode(deep);
// set owner document
- newnode.ownerNode = ownerNode;
+ newnode.setOwnerDocument(ownerDocument());
// Need to break the association w/ original kids
newnode.firstChild = null;
@@ -545,7 +545,7 @@ public abstract class ParentNode extends
childElement.getXMLStreamReader()))
.getDocumentElement();
newElement.build();
- return (OMNode) this.ownerNode.importNode((Element) newElement,
+ return (OMNode)ownerDocument().importNode((Element) newElement,
true);
}
case (OMNode.TEXT_NODE): {
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java?rev=1297980&r1=1297979&r2=1297980&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java
Wed Mar 7 14:37:24 2012
@@ -112,7 +112,7 @@ public class TextImpl extends TextNodeIm
public Node cloneNode(boolean deep) {
TextImpl textImpl = new TextImpl(this.textValue, this.factory);
- textImpl.setOwnerDocument(this.ownerNode);
+ textImpl.setOwnerDocument(ownerDocument());
return textImpl;
}
}
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java?rev=1297980&r1=1297979&r2=1297980&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
Wed Mar 7 14:37:24 2012
@@ -220,7 +220,7 @@ public abstract class TextNodeImpl exten
public TextNodeImpl(OMContainer parent, QName text, int nodeType,
OMFactory factory) {
- this(((ElementImpl) parent).ownerNode, factory);
+ this(((ElementImpl) parent).ownerDocument(), factory);
if (text != null) {
this.textNS =
((ElementImpl)
parent).findNamespace(text.getNamespaceURI(), text.getPrefix());
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java?rev=1297980&r1=1297979&r2=1297980&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java
Wed Mar 7 14:37:24 2012
@@ -270,8 +270,9 @@ public class SOAPEnvelopeImpl extends SO
}
public OMNode getNextOMSibling() throws OMException {
- if (this.ownerNode != null && !this.ownerNode.isComplete()) {
- this.ownerNode.setComplete(true);
+ DocumentImpl ownerDocument = (DocumentImpl)getOwnerDocument();
+ if (ownerDocument != null && !ownerDocument.isComplete()) {
+ ownerDocument.setComplete(true);
}
return null;
}
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPFaultTextImpl.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPFaultTextImpl.java?rev=1297980&r1=1297979&r2=1297980&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPFaultTextImpl.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPFaultTextImpl.java
Wed Mar 7 14:37:24 2012
@@ -23,6 +23,7 @@ import org.apache.axiom.om.OMAttribute;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.om.impl.dom.AttrImpl;
+import org.apache.axiom.om.impl.dom.DocumentImpl;
import org.apache.axiom.soap.SOAP12Constants;
import org.apache.axiom.soap.SOAPFactory;
import org.apache.axiom.soap.SOAPFaultReason;
@@ -57,7 +58,7 @@ public abstract class SOAPFaultTextImpl
public void setLang(String lang) {
langAttr =
- new AttrImpl(this.ownerNode,
+ new AttrImpl((DocumentImpl)getOwnerDocument(),
SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME,
langNamespace,
lang, this.factory);
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java?rev=1297980&r1=1297979&r2=1297980&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java
Wed Mar 7 14:37:24 2012
@@ -26,6 +26,7 @@ import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.om.impl.common.OMNamespaceImpl;
import org.apache.axiom.om.impl.dom.AttrImpl;
+import org.apache.axiom.om.impl.dom.DocumentImpl;
import org.apache.axiom.om.impl.dom.ElementImpl;
import org.apache.axiom.om.impl.dom.ParentNode;
import org.apache.axiom.om.impl.dom.factory.OMDOMFactory;
@@ -86,7 +87,7 @@ public abstract class SOAPHeaderBlockImp
if (omAttribute != null) {
omAttribute.setAttributeValue(attrValue);
} else {
- OMAttribute attribute = new AttrImpl(this.ownerNode, attributeName,
+ OMAttribute attribute = new
AttrImpl((DocumentImpl)getOwnerDocument(), attributeName,
new
OMNamespaceImpl(soapEnvelopeNamespaceURI,
SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX),
attrValue, this.factory);
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java?rev=1297980&r1=1297979&r2=1297980&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java
Wed Mar 7 14:37:24 2012
@@ -59,6 +59,6 @@ public class SOAPMessageImpl extends Doc
protected void internalSerialize(XMLStreamWriter writer, boolean cache,
boolean includeXMLDeclaration) throws
XMLStreamException {
- ((OMNodeEx)
this.ownerNode.getDocumentElement()).internalSerialize(writer, cache);
+
((OMNodeEx)getOwnerDocument().getDocumentElement()).internalSerialize(writer,
cache);
}
}