cziegeler 02/03/28 07:25:05 Modified: src/scratchpad/src/org/apache/cocoon/sunshine/xml XMLUtil.java Log: Synchronization fix Revision Changes Path 1.7 +6 -14 xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/xml/XMLUtil.java Index: XMLUtil.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/xml/XMLUtil.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- XMLUtil.java 11 Mar 2002 11:15:27 -0000 1.6 +++ XMLUtil.java 28 Mar 2002 15:25:05 -0000 1.7 @@ -95,7 +95,7 @@ * @deprecated Do not use this class! We will provide a better solution for most methods soon. * * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a> - * @version CVS $Id: XMLUtil.java,v 1.6 2002/03/11 11:15:27 cziegeler Exp $ + * @version CVS $Id: XMLUtil.java,v 1.7 2002/03/28 15:25:05 cziegeler Exp $ */ public final class XMLUtil { @@ -105,17 +105,6 @@ * for the same reason. */ - /** The TrAX factory for serializing xml */ - public static TransformerFactory transformerFactory = TransformerFactory.newInstance(); - - /** The DOM document factory */ - private static DocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance(); - - static { - documentFactory.setNamespaceAware(true); - documentFactory.setValidating(false); - } - /** * Return the <CODE>Node</CODE> from the DOM Node <CODE>rootNode</CODE> * using the XPath expression <CODE>path</CODE>. @@ -630,7 +619,7 @@ if (node == null) return ""; Writer writer = new StringWriter(); Transformer transformer; - transformer = XMLUtil.transformerFactory.newTransformer(); + transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperties(format); transformer.transform(new DOMSource(node), new StreamResult(writer)); return writer.toString(); @@ -645,7 +634,10 @@ public static Document createDocument() throws ProcessingException { try { - DocumentBuilder docBuilder = XMLUtil.documentFactory.newDocumentBuilder(); + DocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance(); + documentFactory.setNamespaceAware(true); + documentFactory.setValidating(false); + DocumentBuilder docBuilder = documentFactory.newDocumentBuilder(); return docBuilder.newDocument(); } catch (ParserConfigurationException pce) { throw new ProcessingException("Creating document failed.", pce);
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]