From: Wolfgang M. M. <wol...@us...> - 2004-09-12 09:26:05
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/transform In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21081/src/org/exist/xquery/functions/transform Modified Files: Transform.java Added Files: TransformModule.java Removed Files: ModuleImpl.java Log Message: * Added support for XQuery pragmas to set serialization and watchdog settings. * org.exist.storage.serializers.Serializer now passes all output to an instance of the Receiver interface instead of a SAX ContentHandler. Receiver resembles SAX, but has methods that are closer to eXist's internal storage. For example, it directly accepts a QName in startElement to avoid unnecessary string allocations. * Fixed various performance leaks in cross-document joins. Index: Transform.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/transform/Transform.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Transform.java 2 Jul 2004 16:53:55 -0000 1.8 --- Transform.java 12 Sep 2004 09:25:22 -0000 1.9 *************** *** 51,55 **** import org.exist.dom.QName; import org.exist.memtree.MemTreeBuilder; ! import org.exist.memtree.Receiver; import org.exist.security.Permission; import org.exist.security.PermissionDeniedException; --- 51,55 ---- import org.exist.dom.QName; import org.exist.memtree.MemTreeBuilder; ! import org.exist.memtree.DocumentBuilderReceiver; import org.exist.security.Permission; import org.exist.security.PermissionDeniedException; *************** *** 75,79 **** public final static FunctionSignature signature = new FunctionSignature( ! new QName("transform", ModuleImpl.NAMESPACE_URI, ModuleImpl.PREFIX), "Applies an XSL stylesheet to the node tree passed as first argument. The stylesheet " + "is specified in the second argument. This should either be an URI or a node. " + --- 75,79 ---- public final static FunctionSignature signature = new FunctionSignature( ! new QName("transform", TransformModule.NAMESPACE_URI, TransformModule.PREFIX), "Applies an XSL stylesheet to the node tree passed as first argument. The stylesheet " + "is specified in the second argument. This should either be an URI or a node. " + *************** *** 131,135 **** context.pushDocumentContext(); MemTreeBuilder builder = context.getDocumentBuilder(); ! Receiver receiver = new Receiver(builder); SAXResult result = new SAXResult(receiver); handler.setResult(result); --- 131,135 ---- context.pushDocumentContext(); MemTreeBuilder builder = context.getDocumentBuilder(); ! DocumentBuilderReceiver receiver = new DocumentBuilderReceiver(builder); SAXResult result = new SAXResult(receiver); handler.setResult(result); *************** *** 206,210 **** throws XPathException, TransformerConfigurationException { if(stylesheetRoot.getImplementationType() == NodeValue.PERSISTENT_NODE) { ! factory.setURIResolver(new DatabaseResolver(((NodeProxy)stylesheetRoot).doc)); } TemplatesHandler handler = factory.newTemplatesHandler(); --- 206,210 ---- throws XPathException, TransformerConfigurationException { if(stylesheetRoot.getImplementationType() == NodeValue.PERSISTENT_NODE) { ! factory.setURIResolver(new DatabaseResolver(((NodeProxy)stylesheetRoot).getDocument())); } TemplatesHandler handler = factory.newTemplatesHandler(); --- NEW FILE: TransformModule.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2001-03 Wolfgang M. Meier * wol...@ex... * http://exist.sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: TransformModule.java,v 1.1 2004/09/12 09:25:22 wolfgang_m Exp $ */ package org.exist.xquery.functions.transform; import org.exist.xquery.AbstractInternalModule; import org.exist.xquery.FunctionDef; /** * @author Wolfgang Meier (wol...@ex...) */ public class TransformModule extends AbstractInternalModule { public final static String NAMESPACE_URI = "http://exist-db.org/xquery/transform"; public final static String PREFIX = "transform"; private final static FunctionDef functions[] = { new FunctionDef(Transform.signature, Transform.class) }; public TransformModule() { super(functions); } /* (non-Javadoc) * @see org.exist.xquery.Module#getNamespaceURI() */ public String getNamespaceURI() { return NAMESPACE_URI; } /* (non-Javadoc) * @see org.exist.xquery.Module#getDefaultPrefix() */ public String getDefaultPrefix() { return PREFIX; } } --- ModuleImpl.java DELETED --- |