/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* {@link XmlSerializer} for {@link javax.xml.transform.dom.DOMResult} and {@link org.w3c.dom.Node}.
*
* @author Ryan.Shoemaker@Sun.COM
*/
// delegate to SaxSerializer
}
try {
dbf.setNamespaceAware(true);
} catch (ParserConfigurationException pce) {
throw new TxwException(pce);
}
} else {
}
}
// XmlSerializer api's - delegate to SaxSerializer
public void startDocument() {
}
}
}
}
}
public void endTag() {
serializer.endTag();
}
}
}
}
public void endDocument() {
}
public void flush() {
// no flushing
}
}
/**
* Builds a DOM tree from SAX2 events.
*
* @author Vivek Pandey
*/
private boolean inCDATA;
}
/**
* Document object that owns the specified node.
*/
/**
* @param node
* Nodes will be created and added under this object.
*/
{
else
}
/**
* Creates a fresh empty DOM document and adds nodes under this document.
*/
factory.setNamespaceAware(true);
factory.setValidating(false);
}
return _node;
}
public void startDocument() {
}
public void endDocument(){
}
// some broken DOM implementatino (we confirmed it with SAXON)
// return null from this method.
// if so, report an user-friendly error message,
// rather than dying mysteriously with NPE.
throw new TxwException("Your DOM provider doesn't support the createElementNS method properly");
}
// process namespace bindings
qname = "xmlns";
else
// older version of Xerces (I confirmed that the bug is gone with Xerces 2.4.0)
// have a problem of re-setting the same namespace attribute twice.
// work around this bug removing it first.
// further workaround for an old Crimson bug where the removeAttribtueNS
// method throws NPE when the element doesn't have any attribute.
// to be on the safe side, check the existence of attributes before
// attempting to remove it.
// for details about this bug, see org.apache.crimson.tree.ElementNode2
// line 540 or the following message:
}
// workaround until here
}
for(int i=0;i<length;i++){
}
// append this new node onto current stack node
// push this node onto stack
}
}
}
if(inCDATA)
else
}
}
}
}
}
}
}
}
}
}
}
}
inCDATA = true;
}
inCDATA = false;
}
}