You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tw...@apache.org on 2001/02/21 22:30:49 UTC
cvs commit: xml-xerces/java/src/org/apache/xml/serialize HTMLdtd.java
twl 01/02/21 13:30:49
Modified: java build.xml
java/src/org/apache/xml/serialize HTMLdtd.java
Log:
Apply patch for arkin & Davanum Srinivas to correctly handle .res file
for serializers
Submitted by:Arkin, Davanum Srinivas
Reviewed by:twl
Revision Changes Path
1.36 +7 -1 xml-xerces/java/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/xml-xerces/java/build.xml,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- build.xml 2001/01/30 21:39:14 1.35
+++ build.xml 2001/02/21 21:30:46 1.36
@@ -51,7 +51,7 @@
Copyright:
Copyright (c) 2000 The Apache Software Foundation.
- $Id: build.xml,v 1.35 2001/01/30 21:39:14 neilg Exp $
+ $Id: build.xml,v 1.36 2001/02/21 21:30:46 twl Exp $
==================================================================== -->
@@ -186,6 +186,12 @@
<!-- Compiles the source directory -->
<!-- =================================================================== -->
<target name="compile" depends="prepare-src">
+ <copy todir="${build.dest}">
+ <fileset dir="${build.src}">
+ <include name="**/*.res"/>
+ </fileset>
+ </copy>
+
<javac srcdir="${build.src}"
excludes="**/RevalidatingDOMParser.java "
destdir="${build.dest}"
1.11 +10 -4 xml-xerces/java/src/org/apache/xml/serialize/HTMLdtd.java
Index: HTMLdtd.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/HTMLdtd.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- HTMLdtd.java 2000/12/14 19:21:52 1.10
+++ HTMLdtd.java 2001/02/21 21:30:48 1.11
@@ -81,7 +81,7 @@
* first time any of these methods is called for fast and efficient access.
*
*
- * @version $Revision: 1.10 $ $Date: 2000/12/14 19:21:52 $
+ * @version $Revision: 1.11 $ $Date: 2001/02/21 21:30:48 $
* @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
*/
public final class HTMLdtd
@@ -115,9 +115,8 @@
* Locates the HTML entities file that is loaded upon initialization.
* This file is a resource loaded with the default class loader.
*/
- private static final String ENTITIES_RESOURCE = "HTMLEntities.res";
+ private static final String ENTITIES_RESOURCE = "org/apache/xml/serialize/HTMLEntities.res";
-
/**
* Only opening tag should be printed.
*/
@@ -391,7 +390,14 @@
try {
_byName = new Hashtable();
_byChar = new Hashtable();
- is = HTMLdtd.class.getResourceAsStream( ENTITIES_RESOURCE );
+
+ ClassLoader cl=HTMLdtd.class.getClassLoader();
+ if( cl == null ) {
+ is=ClassLoader.getSystemResourceAsStream( ENTITIES_RESOURCE );
+ } else {
+ is=cl.getResourceAsStream( ENTITIES_RESOURCE );
+ }
+
if ( is == null )
throw new RuntimeException( "SER003 The resource [" + ENTITIES_RESOURCE + "] could not be found.\n" + ENTITIES_RESOURCE);
reader = new BufferedReader( new InputStreamReader( is ) );