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