rpms/openoffice.org/devel openoffice.org-1.9.130.ooo54692.fasterhelpcontent2.patch, 1.7, 1.8 openoffice.org.spec, 1.533, 1.534 workspace.jaxpapi.patch, 1.3, 1.4

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Nov 9 19:15:15 UTC 2005


Author: caolanm

Update of /cvs/dist/rpms/openoffice.org/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv9593

Modified Files:
	openoffice.org-1.9.130.ooo54692.fasterhelpcontent2.patch 
	openoffice.org.spec workspace.jaxpapi.patch 
Log Message:
to hell with DocumentTraversal stuff

openoffice.org-1.9.130.ooo54692.fasterhelpcontent2.patch:
 bin/deliver.pl                               |    0 
 config_office/set_soenv.in                   |    9 ++++++---
 helpcontent2/util/target.pmk                 |    5 ++++-
 prj/d.lst                                    |    0 
 solenv/bin/deliver.pl                        |    4 +++-
 source/com/sun/star/help/makefile.mk         |    0 
 util/target.pmk                              |    0 
 xmlhelp/prj/d.lst                            |    1 +
 xmlhelp/source/com/sun/star/help/makefile.mk |   17 +++++++++++++++++
 9 files changed, 31 insertions(+), 5 deletions(-)

Index: openoffice.org-1.9.130.ooo54692.fasterhelpcontent2.patch
===================================================================
RCS file: /cvs/dist/rpms/openoffice.org/devel/openoffice.org-1.9.130.ooo54692.fasterhelpcontent2.patch,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- openoffice.org-1.9.130.ooo54692.fasterhelpcontent2.patch	9 Nov 2005 11:11:02 -0000	1.7
+++ openoffice.org-1.9.130.ooo54692.fasterhelpcontent2.patch	9 Nov 2005 19:15:12 -0000	1.8
@@ -105,7 +105,7 @@
 +	$(JAVACOMPILER) --main=com.sun.star.help.HelpLinker -o $(BIN)$/HelpLinker \
 +		-O2 -Wl,-Bsymbolic -findirect-dispatch -fjni -fno-assert -Wno-deprecated \
 +		$(JAVACPS) $(CLASSPATH) $(JAVAFILES) $(SOLARLIB) -L$(LB) \
-+		-ldb.jar -lxmlsearch.jar -lxt.jar -lunoil.jar -ljurt.jar -lridl.jar -lparser.jar
++		-ldb.jar -lxmlsearch.jar -lxt.jar -lunoil.jar -ljurt.jar -lridl.jar
 +
 +$(LB)$/libdb.jar.a:
 +	$(JAVACOMPILER) -c -O2 -findirect-dispatch -fjni $(DB_JAR) -o $(LB)$/libdb.jar.a


Index: openoffice.org.spec
===================================================================
RCS file: /cvs/dist/rpms/openoffice.org/devel/openoffice.org.spec,v
retrieving revision 1.533
retrieving revision 1.534
diff -u -r1.533 -r1.534
--- openoffice.org.spec	9 Nov 2005 10:45:31 -0000	1.533
+++ openoffice.org.spec	9 Nov 2005 19:15:12 -0000	1.534
@@ -1,6 +1,6 @@
 %define oootag SRC680
 %define ooomilestone 138
-%define rh_rpm_release 3
+%define rh_rpm_release 4
 
 %define build_fc5 1
 %define build_fc4 0
@@ -870,7 +870,7 @@
 %patch49 -p1 -b .workspace.cmcfixes20.patch
 %patch50 -p1 -b .ooo56536.sw.rtfcrash.patch
 %patch51 -p1 -b .workspace.systemlibxmlfix.patch
-# %patch52 -p1 -b .workspace.jaxpapi.patch
+%patch52 -p1 -b .workspace.jaxpapi.patch
 
 %if %{includingexternals}
 #start ludicrous workaround
@@ -951,7 +951,7 @@
 export JAVACOMPILER=`pwd`/solenv/bin/gcj
 %endif
 
-#rm -rf external/common/jaxp.jar external/common/parser.jar
+rm -rf external/common/jaxp.jar external/common/parser.jar
 
 %if ! %{internaljavabits}
 export XML_CLASSPATH=/usr/share/java/xalan-j2.jar:/usr/share/java/xerces-j2.jar
@@ -3241,6 +3241,9 @@
 %{instdir}/share/registry/modules/org/openoffice/Office/Scripting/Scripting-python.xcu
 
 %changelog
+* Wed Nov 08 2005 Caolan McNamara <caolanm at redhat.com> - 1:2.0.1-0.138.4
+- add workspace.jaxpapi.patch and drop parser.jar and jaxp.jar
+
 * Wed Nov 08 2005 Caolan McNamara <caolanm at redhat.com> - 1:2.0.1-0.138.3
 - fix problem with icu rule searching with null locale
 

workspace.jaxpapi.patch:
 source/com/sun/star/help/HelpCompiler.java           |    0 
 source/com/sun/star/help/HelpIndexer.java            |    0 
 source/com/sun/star/help/PreTransformer.java         |    0 
 xmlhelp/source/com/sun/star/help/HelpCompiler.java   |  333 +++++++++++++------
 xmlhelp/source/com/sun/star/help/HelpIndexer.java    |    6 
 xmlhelp/source/com/sun/star/help/PreTransformer.java |    1 
 6 files changed, 236 insertions(+), 104 deletions(-)

Index: workspace.jaxpapi.patch
===================================================================
RCS file: /cvs/dist/rpms/openoffice.org/devel/workspace.jaxpapi.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- workspace.jaxpapi.patch	8 Nov 2005 13:51:34 -0000	1.3
+++ workspace.jaxpapi.patch	9 Nov 2005 19:15:13 -0000	1.4
@@ -4,8 +4,8 @@
 retrieving revision 1.10
 diff -u -p -u -r1.10 HelpCompiler.java
 --- openoffice.org.orig/xmlhelp/source/com/sun/star/help/HelpCompiler.java	9 Sep 2005 12:15:19 -0000	1.10
-+++ openoffice.org/xmlhelp/source/com/sun/star/help/HelpCompiler.java	8 Nov 2005 12:22:47 -0000
-@@ -44,6 +44,7 @@
++++ openoffice.org/xmlhelp/source/com/sun/star/help/HelpCompiler.java	9 Nov 2005 13:19:49 -0000
+@@ -44,6 +44,7 @@ package com.sun.star.help;
  import java.io.ByteArrayInputStream;
  import java.io.File;
  import java.io.IOException;
@@ -13,7 +13,7 @@
  import java.io.InputStreamReader;
  import java.io.UnsupportedEncodingException;
  import java.net.MalformedURLException;
-@@ -55,16 +56,19 @@
+@@ -55,16 +56,20 @@ import java.util.Iterator;
  import java.util.LinkedList;
  import java.util.List;
  
@@ -28,6 +28,7 @@
 +import org.w3c.dom.traversal.DocumentTraversal;
 +import org.w3c.dom.traversal.NodeFilter;
 +import org.w3c.dom.traversal.TreeWalker;
++import org.w3c.dom.traversal.NodeIterator;
  import org.xml.sax.InputSource;
  
 -import com.sun.xml.tree.TreeWalker;
@@ -36,7 +37,7 @@
  public class HelpCompiler implements HelpURLStreamHandlerFactory.Notify {
  
  	private static final String makeRelPrefix = ".." + File.separator;
-@@ -113,24 +117,29 @@
+@@ -113,24 +118,24 @@ public class HelpCompiler implements Hel
  		urlHandler.setNotify(this);
  	}
  
@@ -58,30 +59,26 @@
 -				} else if (nl.item(i).getNodeName().equals("defaultinline")) {
 -					hs.add("DEFAULT");
 -				}
-+		DocumentTraversal dt = (DocumentTraversal) doc;
-+		TreeWalker tw = dt.createTreeWalker(doc, NodeFilter.SHOW_ALL, null, false);
-+		Node next = tw.firstChild(); // Start with first child
-+
-+		while (next != null) {
-+			if (next.getNodeName() == "switchinline") {
-+			    Element el = (Element) next;
-+			    if (el.getAttribute("select").equals("appl")) {
-+			        NodeList nl = el.getChildNodes();
-+			        for (int i = 0; i < nl.getLength(); ++i) {
-+				        if (nl.item(i).getNodeName().equals("caseinline")) {
-+					        String appl = ((Element) nl.item(i)).getAttribute("select");
-+					        hs.add(appl);
-+				        } else if (nl.item(i).getNodeName().equals("defaultinline")) {
-+					        hs.add("DEFAULT");
-+				        }
-+                    }
+-			}
++		NodeList nodelist = doc.getElementsByTagName("switchinline");
++
++		for (int j = 0; j < nodelist.getLength(); ++j) {
++		    Element el = (Element) nodelist.item(j);
++		    if (el.getAttribute("select").equals("appl")) {
++		        NodeList nl = el.getChildNodes();
++		        for (int i = 0; i < nl.getLength(); ++i) {
++			        if (nl.item(i).getNodeName().equals("caseinline")) {
++				        String appl = ((Element) nl.item(i)).getAttribute("select");
++				        hs.add(appl);
++			        } else if (nl.item(i).getNodeName().equals("defaultinline")) {
++				        hs.add("DEFAULT");
++			        }
 +                }
- 			}
-+			next = tw.nextSibling(); // Get the next child
++            }
  		}
  
  		hs.add("DEFAULT");
-@@ -144,6 +153,9 @@
+@@ -144,6 +149,9 @@ public class HelpCompiler implements Hel
  		NodeList nl = node.getChildNodes();
  		for (int i = 0; i < nl.getLength(); ++i) {
  			Node n = nl.item(i);
@@ -91,21 +88,78 @@
  			if ((n.getNodeName().equals("switchinline")
  				|| n.getNodeName().equals("switch"))
  				&& ((Element) n).getAttribute("select").equals("appl")) {
-@@ -183,7 +195,102 @@
+@@ -183,89 +191,125 @@ public class HelpCompiler implements Hel
  		return parent;
  	}
  
 -	public boolean compile() throws UnsupportedEncodingException {
+-		// we now have the jaroutputstream, which will contain the document.
+-		// now determine the document as a dom tree in variable docResolved
+-		String absolutePath;
+-		String sourcePath;
+-		File inputFil = new File(inputFile);
+-		try {
+-			absolutePath = inputFil.getCanonicalPath();
+-		} catch (IOException e3) {
+-			absolutePath = inputFil.getAbsolutePath();
+-		}
+-		try {
+-			sourcePath = new File(src).getCanonicalPath();
+-		} catch (IOException e3) {
+-			sourcePath = new File(inputFile).getAbsolutePath();
+-		}
 +    static byte[] docToBytes(Document doc)
 +        throws IOException {
-+
+ 
+-		byte[] embResolved = null;
+-		try {
+-			embResolved = getSourceDocument(inputFil.toURL().toExternalForm());
+-		} catch (MalformedURLException e4) {
+-			System.err.println(
+-				"ERROR: malformed URL '" + inputFile + "': " + e4.getMessage());
+-			return false;
+-		}
 +        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-+
+ 
+-		// now add path to the document
+-		// resolve the dom
+-		if (embResolved == null) {
+-			System.err.println("ERROR: file not existing: " + sourcePath);
+-			System.exit(1);
+-		}
+-
+-		ByteArrayInputStream inByte = new ByteArrayInputStream(embResolved);
+-		InputStreamReader inread;
+-		try {
+-			inread = new InputStreamReader(inByte, "UTF8");
+-		} catch (UnsupportedEncodingException e) {
+-			System.err.println(
+-				"ERROR: unsupported Encoding '"
+-					+ inputFile
+-					+ "': "
+-					+ e.getMessage());
+-			return false;
+-		}
+-
+-		InputSource inputSource = new InputSource(inread);
+-		inputSource.setEncoding("UTF8");
+-		Document docResolvedOrg = null;
+-		try {
+-			docResolvedOrg = XmlDocument.createXmlDocument(inputSource, false);
+-		} catch (Exception e) {
+-			System.err.println(
+-				"ERROR: XmlDocument.createXmlDocument() failed for '"
+-					+ inputFile
+-					+ "': "
+-					+ e.getMessage());
+-			return false;
+-		}
 +        java.lang.reflect.Constructor con;
 +        java.lang.reflect.Method meth;
 +        
 +        String domImpl = doc.getClass().getName();
-+
+ 
+-		// now find all applications for which one has to compile
 +        /*
 +         * We may have multiple XML parsers in the Classpath.
 +         * Depending on which one is first, the actual type of
@@ -191,66 +245,182 @@
 +        return bytes;
 +    }
 +
-+	public boolean compile() throws UnsupportedEncodingException, java.io.IOException {
- 		// we now have the jaroutputstream, which will contain the document.
- 		// now determine the document as a dom tree in variable docResolved
- 		String absolutePath;
-@@ -233,7 +340,10 @@
- 		inputSource.setEncoding("UTF8");
- 		Document docResolvedOrg = null;
- 		try {
--			docResolvedOrg = XmlDocument.createXmlDocument(inputSource, false);
-+			DocumentBuilderFactory dFactory = DocumentBuilderFactory.newInstance();
-+			dFactory.setValidating(false);
-+			DocumentBuilder dBuilder = dFactory.newDocumentBuilder();
-+			docResolvedOrg = dBuilder.parse(inputSource);
- 		} catch (Exception e) {
- 			System.err.println(
- 				"ERROR: XmlDocument.createXmlDocument() failed for '"
-@@ -257,15 +367,17 @@
- 				(Element) clone(docResolvedOrg.getDocumentElement(), appl);
- 			// now determine the id of the document, which is part of the
- 			// bookmark - tag (HID)
++
++	public class myparser {
++		HashSet hidlist = null;
++		HashSet extendedHelpText = null;
++		Hashtable keywords = null;
++		Hashtable helptexts = null;
+ 		String documentId = null;
+ 		String fileName = null;
+ 		String title = null;
+-		// returns all applications for which one has to compile
+-		Object[] applications = switchFind(docResolvedOrg);
+-        
+-        for (int i = 0; i < applications.length; ++i) {
+-			String appl = (String) applications[i];
+-            // returns a clone of the document with swich-cases resolved
+-			Element docResolved =
+-				(Element) clone(docResolvedOrg.getDocumentElement(), appl);
+-			// now determine the id of the document, which is part of the
+-			// bookmark - tag (HID)
 -			Node test;
 -			TreeWalker treewalker = new TreeWalker(docResolved);
-+                        DocumentTraversal dt = (DocumentTraversal) docResolved.getOwnerDocument();
-+                        TreeWalker tw = dt.createTreeWalker(docResolved, NodeFilter.SHOW_ALL, null, false);
-+
- 			// a number to determine the anchor of the whole stuff
- 			HashSet hidlist = new HashSet();
- 			HashSet extendedHelpText = new HashSet();
- 			Hashtable keywords = new Hashtable();
- 			Hashtable helptexts = new Hashtable();
+-			// a number to determine the anchor of the whole stuff
+-			HashSet hidlist = new HashSet();
+-			HashSet extendedHelpText = new HashSet();
+-			Hashtable keywords = new Hashtable();
+-			Hashtable helptexts = new Hashtable();
 -            
 -			while ((test = treewalker.getNext()) != null) {
-+           
-+            Node test = tw.firstChild();
-+            while (test != null) {
++
++		public myparser(String indocumentId, String infileName, String intitle) {
++				hidlist = new HashSet();
++				extendedHelpText = new HashSet();
++				keywords = new Hashtable();
++				helptexts = new Hashtable();
++				documentId = indocumentId;
++				fileName = infileName;
++				title = intitle;
++		}
++
++		public void traverse( Node parentNode ) {
++			// traverse all nodes that belong to the parent
++			for(Node test=parentNode.getFirstChild(); test!=null; test=test.getNextSibling()) {
++
  				if (fileName == null
  					&& test.getNodeName().equals("filename")) {
  					NodeList list = test.getChildNodes();
-@@ -345,12 +457,13 @@
+@@ -345,15 +389,102 @@ public class HelpCompiler implements Hel
  					if (!extendedHelpText.isEmpty())
  						extendedHelpText = new HashSet();
  				}
-+				test = tw.nextSibling(); // Get the next child
- 			} // now save the info
+-			} // now save the info
++			  // traverse children
++			  traverse(test);
++			}
++		  }
++	}
++
++	public boolean compile() throws UnsupportedEncodingException, java.io.IOException {
++		// we now have the jaroutputstream, which will contain the document.
++		// now determine the document as a dom tree in variable docResolved
++		String absolutePath;
++		String sourcePath;
++		File inputFil = new File(inputFile);
++		try {
++			absolutePath = inputFil.getCanonicalPath();
++		} catch (IOException e3) {
++			absolutePath = inputFil.getAbsolutePath();
++		}
++		try {
++			sourcePath = new File(src).getCanonicalPath();
++		} catch (IOException e3) {
++			sourcePath = new File(inputFile).getAbsolutePath();
++		}
++
++		byte[] embResolved = null;
++		try {
++			embResolved = getSourceDocument(inputFil.toURL().toExternalForm());
++		} catch (MalformedURLException e4) {
++			System.err.println(
++				"ERROR: malformed URL '" + inputFile + "': " + e4.getMessage());
++			return false;
++		}
++
++		// now add path to the document
++		// resolve the dom
++		if (embResolved == null) {
++			System.err.println("ERROR: file not existing: " + sourcePath);
++			System.exit(1);
++		}
++
++		ByteArrayInputStream inByte = new ByteArrayInputStream(embResolved);
++		InputStreamReader inread;
++		try {
++			inread = new InputStreamReader(inByte, "UTF8");
++		} catch (UnsupportedEncodingException e) {
++			System.err.println(
++				"ERROR: unsupported Encoding '"
++					+ inputFile
++					+ "': "
++					+ e.getMessage());
++			return false;
++		}
++
++		InputSource inputSource = new InputSource(inread);
++		inputSource.setEncoding("UTF8");
++		Document docResolvedOrg = null;
++		try {
++			System.err.println("Compiling " + inputFile);
++			DocumentBuilderFactory dFactory = DocumentBuilderFactory.newInstance();
++			dFactory.setValidating(false);
++			DocumentBuilder dBuilder = dFactory.newDocumentBuilder();
++			docResolvedOrg = dBuilder.parse(inputSource);
++		} catch (Exception e) {
++			System.err.println(
++				"ERROR: XmlDocument.createXmlDocument() failed for '"
++					+ inputFile
++					+ "': "
++					+ e.getMessage());
++			return false;
++		}
++
++		// now find all applications for which one has to compile
++		String documentId = null;
++		String fileName = null;
++		String title = null;
++		// returns all applications for which one has to compile
++		Object[] applications = switchFind(docResolvedOrg);
++        
++        for (int i = 0; i < applications.length; ++i) {
++			String appl = (String) applications[i];
++            // returns a clone of the document with swich-cases resolved
++			Element docResolved =
++				(Element) clone(docResolvedOrg.getDocumentElement(), appl);
++
++			myparser aparser = new myparser(documentId, fileName, title);
++			aparser.traverse(docResolved);
++			documentId = aparser.documentId;
++			fileName = aparser.fileName;
++			title = aparser.title;
  
  			addEntryToJarFile(
  				appl,
  				"text",
 -				docResolved.toString().getBytes("UTF8"));
+-			addEntryToJarFile(appl, "hidlist", hidlist);
+-			addEntryToJarFile(appl, "helptexts", helptexts);
+-			addEntryToJarFile(appl, "keywords", keywords);
 +				docToBytes(docResolved.getOwnerDocument()));
- 			addEntryToJarFile(appl, "hidlist", hidlist);
- 			addEntryToJarFile(appl, "helptexts", helptexts);
- 			addEntryToJarFile(appl, "keywords", keywords);
++			addEntryToJarFile(appl, "hidlist", aparser.hidlist);
++			addEntryToJarFile(appl, "helptexts", aparser.helptexts);
++			addEntryToJarFile(appl, "keywords", aparser.keywords);
+ 		} // end iteration over all applications
+ 
+ 		try {
+Index: source/com/sun/star/help/PreTransformer.java
+===================================================================
+RCS file: /cvs/util/xmlhelp/source/com/sun/star/help/PreTransformer.java,v
+retrieving revision 1.6
+diff -u -p -u -r1.6 PreTransformer.java
+--- openoffice.org.orig/xmlhelp/source/com/sun/star/help/PreTransformer.java	25 Jan 2005 15:29:16 -0000	1.6
++++ openoffice.org/xmlhelp/source/com/sun/star/help/PreTransformer.java	9 Nov 2005 13:19:52 -0000
+@@ -8,7 +8,6 @@ import java.util.zip.CRC32;
+ import java.util.zip.ZipEntry;
+ 
+ import org.w3c.dom.*;
+-import com.sun.xml.tree.*;
+ import org.xml.sax.*;
+ import javax.xml.parsers.*;
+ import com.jclark.xsl.sax.*;
 Index: source/com/sun/star/help/HelpIndexer.java
 ===================================================================
 RCS file: /cvs/util/xmlhelp/source/com/sun/star/help/HelpIndexer.java,v
 retrieving revision 1.16
 diff -u -p -u -r1.16 HelpIndexer.java
 --- openoffice.org.orig/xmlhelp/source/com/sun/star/help/HelpIndexer.java	25 Oct 2005 11:24:55 -0000	1.16
-+++ openoffice.org/xmlhelp/source/com/sun/star/help/HelpIndexer.java	8 Nov 2005 12:22:47 -0000
++++ openoffice.org/xmlhelp/source/com/sun/star/help/HelpIndexer.java	9 Nov 2005 13:24:14 -0000
 @@ -46,7 +46,6 @@ import java.net.URL;
  import java.util.*;
  
@@ -271,215 +441,3 @@
  					} catch (Exception e) {
  						if (docResolved == null)
  							System.err.println("Nullpointer");
-Index: source/com/sun/star/help/PreTransformer.java
-===================================================================
-RCS file: /cvs/util/xmlhelp/source/com/sun/star/help/PreTransformer.java,v
-retrieving revision 1.6
-diff -u -p -u -r1.6 PreTransformer.java
---- openoffice.org.orig/xmlhelp/source/com/sun/star/help/PreTransformer.java	25 Jan 2005 15:29:16 -0000	1.6
-+++ openoffice.org/xmlhelp/source/com/sun/star/help/PreTransformer.java	8 Nov 2005 12:22:49 -0000
-@@ -8,7 +8,6 @@ import java.util.zip.CRC32;
- import java.util.zip.ZipEntry;
- 
- import org.w3c.dom.*;
--import com.sun.xml.tree.*;
- import org.xml.sax.*;
- import javax.xml.parsers.*;
- import com.jclark.xsl.sax.*;
-Index: src/com/sun/xmlsearch/tree/TreeBuilder.java
-===================================================================
-RCS file: /cvs/util/XmlSearch/src/com/sun/xmlsearch/tree/TreeBuilder.java,v
-retrieving revision 1.2
-diff -u -p -u -r1.2 TreeBuilder.java
---- openoffice.org.orig/XmlSearch/src/com/sun/xmlsearch/tree/TreeBuilder.java	9 Sep 2005 16:41:49 -0000	1.2
-+++ openoffice.org/XmlSearch/src/com/sun/xmlsearch/tree/TreeBuilder.java	8 Nov 2005 12:27:08 -0000
-@@ -46,7 +46,8 @@ import javax.swing.tree.TreeNode;
- import org.xml.sax.HandlerBase;
- import org.xml.sax.AttributeList;
- import org.xml.sax.InputSource;
--import com.sun.xml.parser.Parser;
-+import javax.xml.parsers.SAXParserFactory;
-+import javax.xml.parsers.SAXParser;
- import com.sun.xmlsearch.util.IntegerArray;
- import com.jclark.xsl.om.*;
- 
-@@ -610,22 +611,29 @@ public final class TreeBuilder extends H
- 		}
-     } // end of SubstitutedElement
- 
-+    private SAXParser getParser() throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
-+    {
-+        SAXParserFactory spf = SAXParserFactory.newInstance();
-+        spf.setValidating(false);
-+        return spf.newSAXParser();
-+    }
-+
-     private static final int InitStackSize = 256;
-     private static final Name EmptyName = null;
--    private Parser _parser = new Parser();
-+    private SAXParser _parser = null;
-     private Hashtable _names = new Hashtable(256);
-   
-     private NameTable _nameTable;
-     private NamespacePrefixMap _nsMap;
-   
--    public TreeBuilder() {
-+    public TreeBuilder() throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException {
- 		this(new NameTableImpl());
-     }
- 
--    public TreeBuilder(NameTable nameTable) {
-+    public TreeBuilder(NameTable nameTable) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException {
-+		_parser = getParser();
- 		_nameTable = nameTable;
- 		_nsMap = _nameTable.getEmptyNamespacePrefixMap();
--		_parser.setFastStandalone(true);
-     }
- 
-     public Node makeSubstituteElement(Name name, Node2[] children, Node original) {
-@@ -917,9 +925,8 @@ public final class TreeBuilder extends H
-     
-     public synchronized Node getRoot(InputSource input) {
- 		try {
--			_parser.setDocumentHandler(this);
- 			// long start = System.currentTimeMillis();
--			_parser.parse(input);
-+			_parser.parse(input, this);
- 			/*
- 			  System.out.println((System.currentTimeMillis()-start)
- 			  +" msec parse");
-Index: src/com/sun/xmlsearch/util/Configuration.java
-===================================================================
-RCS file: /cvs/util/XmlSearch/src/com/sun/xmlsearch/util/Configuration.java,v
-retrieving revision 1.2
-diff -u -p -u -r1.2 Configuration.java
---- openoffice.org.orig/XmlSearch/src/com/sun/xmlsearch/util/Configuration.java	9 Sep 2005 16:45:09 -0000	1.2
-+++ openoffice.org/XmlSearch/src/com/sun/xmlsearch/util/Configuration.java	8 Nov 2005 12:27:10 -0000
-@@ -40,8 +40,8 @@ import java.io.ByteArrayInputStream;
- import java.util.Vector;
- import java.net.URL;
- import org.w3c.dom.*;
--import com.sun.xml.tree.XmlDocument;
--import com.sun.xml.parser.Resolver;
-+import javax.xml.parsers.DocumentBuilder;
-+import javax.xml.parsers.DocumentBuilderFactory;
- import org.xml.sax.InputSource;
- 
- public final class Configuration {
-@@ -68,14 +68,19 @@ public final class Configuration {
-     }
- 
-     public static Element parse(URL location) throws Exception {
--	InputSource input = Resolver.createInputSource(location, true);
--	XmlDocument document = XmlDocument.createXmlDocument(input, false);
-+	DocumentBuilderFactory dFactory = DocumentBuilderFactory.newInstance();
-+	dFactory.setValidating(false);
-+	DocumentBuilder dBuilder = dFactory.newDocumentBuilder();
-+	Document document = dBuilder.parse(location.openStream());
- 	return document.getDocumentElement();
-     }
- 
-     public static Element parse(byte[] xmlBytes) throws Exception {
- 	ByteArrayInputStream input = new ByteArrayInputStream(xmlBytes);
--	XmlDocument document = XmlDocument.createXmlDocument(input, false);
-+	DocumentBuilderFactory dFactory = DocumentBuilderFactory.newInstance();
-+	dFactory.setValidating(false);
-+	DocumentBuilder dBuilder = dFactory.newDocumentBuilder();
-+	Document document = dBuilder.parse(input);
- 	return document.getDocumentElement();
-     }
- 
-Index: src/com/sun/xmlsearch/xml/indexer/XmlIndexBuilder.java
-===================================================================
-RCS file: /cvs/util/XmlSearch/src/com/sun/xmlsearch/xml/indexer/XmlIndexBuilder.java,v
-retrieving revision 1.7
-diff -u -p -u -r1.7 XmlIndexBuilder.java
---- openoffice.org.orig/XmlSearch/src/com/sun/xmlsearch/xml/indexer/XmlIndexBuilder.java	9 Sep 2005 16:52:56 -0000	1.7
-+++ openoffice.org/XmlSearch/src/com/sun/xmlsearch/xml/indexer/XmlIndexBuilder.java	8 Nov 2005 12:27:11 -0000
-@@ -42,15 +42,17 @@ import java.util.Enumeration;
- import java.net.URL;
- import org.xml.sax.InputSource;
- import org.xml.sax.HandlerBase;
--import com.sun.xml.parser.Resolver;
--import com.sun.xml.tree.XmlDocument;
- import com.sun.xmlsearch.tree.*;
- import com.sun.xmlsearch.util.*;
- import com.sun.xmlsearch.db.*;
- import com.sun.xmlsearch.xml.XmlIndex;
- 
--import com.sun.xml.parser.Parser;
--import com.sun.xml.parser.ValidatingParser;
-+import javax.xml.parsers.DocumentBuilder;
-+import javax.xml.parsers.DocumentBuilderFactory;
-+import javax.xml.parsers.SAXParserFactory;
-+import javax.xml.parsers.SAXParser;
-+import org.xml.sax.Parser;
-+import org.w3c.dom.Document;
- 
- import com.jclark.xsl.om.*;
- import com.jclark.xsl.sax.*;
-@@ -465,8 +467,11 @@ public final class XmlIndexBuilder {
- 	public void indexDocument(URL docURL, String title) throws Exception {
- 		InputSource source = new InputSource(docURL.openStream());
- 		source.setSystemId(docURL.toString());
--		Parser sourceParser = new Parser();
--		sourceParser.setFastStandalone(true);
-+        	SAXParserFactory spf = SAXParserFactory.newInstance();
-+		spf.setValidating(false);
-+		SAXParser saxParser = spf.newSAXParser();
-+		Parser sourceParser = saxParser.getParser();
-+
- 		XMLProcessorEx sourceLoader = new XMLProcessorImpl(sourceParser);
- 		//	long start = System.currentTimeMillis();
- 		Node root =
-@@ -545,8 +550,12 @@ public final class XmlIndexBuilder {
- 		}
- 		// System.out.println(stylesheetUrl.toString());
- 		InputStream stylesheetStream = stylesheetUrl.openStream();
--		XmlDocument sheet =
--			XmlDocument.createXmlDocument(stylesheetStream, false);
-+
-+		DocumentBuilderFactory dFactory = DocumentBuilderFactory.newInstance();
-+		dFactory.setValidating(false);
-+		DocumentBuilder dBuilder = dFactory.newDocumentBuilder();
-+		Document sheet = dBuilder.parse(stylesheetStream);
-+
- 		return _transformEngine.createTransform(sheet);
- 	}
- 
-Index: src/com/sun/xmlsearch/xml/indexer/XmlIndexer.java
-===================================================================
-RCS file: /cvs/util/XmlSearch/src/com/sun/xmlsearch/xml/indexer/XmlIndexer.java,v
-retrieving revision 1.2
-diff -u -p -u -r1.2 XmlIndexer.java
---- openoffice.org.orig/XmlSearch/src/com/sun/xmlsearch/xml/indexer/XmlIndexer.java	9 Sep 2005 16:53:09 -0000	1.2
-+++ openoffice.org/XmlSearch/src/com/sun/xmlsearch/xml/indexer/XmlIndexer.java	8 Nov 2005 12:27:14 -0000
-@@ -39,8 +39,6 @@ import java.net.MalformedURLException;
- import java.io.*;
- import java.util.*;
- 
--import com.sun.xml.tree.XmlDocument;
--import com.sun.xml.parser.Resolver;
- import org.w3c.dom.*;
- import org.xml.sax.InputSource;
- import org.xml.sax.SAXException;
-Index: org/openoffice/configuration/XMLDefaultGenerator.java
-===================================================================
-RCS file: /cvs/util/officecfg/org/openoffice/configuration/XMLDefaultGenerator.java,v
-retrieving revision 1.4
-diff -u -p -u -r1.4 XMLDefaultGenerator.java
---- openoffice.org.orig/officecfg/org/openoffice/configuration/XMLDefaultGenerator.java	8 Sep 2005 14:43:34 -0000	1.4
-+++ openoffice.org/officecfg/org/openoffice/configuration/XMLDefaultGenerator.java	8 Nov 2005 13:49:42 -0000
-@@ -36,12 +36,10 @@ package org.openoffice.configuration;
- 
- import org.xml.sax.*;
- import org.w3c.dom.*;
--import com.sun.xml.tree.XmlDocument;
- import org.xml.sax.SAXException;
- import org.xml.sax.SAXParseException;
- import javax.xml.parsers.SAXParserFactory;
- import javax.xml.parsers.SAXParser;
--import com.sun.xml.tree.*;
- import java.util.*;
- import java.io.*;
- import com.jclark.xsl.sax.Driver;




More information about the fedora-cvs-commits mailing list