KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > nu > xom > JDK15XML1_0Parser


1 // Copyright 2004 Elliotte Rusty Harold
2
//
3
// This library is free software; you can redistribute
4
// it and/or modify it under the terms of version 2.1 of
5
// the GNU Lesser General Public License as published by
6
// the Free Software Foundation.
7
//
8
// This library is distributed in the hope that it will be useful,
9
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
// GNU Lesser General Public License for more details.
12
//
13
// You should have received a copy of the GNU Lesser General
14
// Public License along with this library; if not, write to the
15
// Free Software Foundation, Inc., 59 Temple Place, Suite 330,
16
// Boston, MA 02111-1307 USA
17
//
18
// You can contact Elliotte Rusty Harold by sending e-mail to
19
// elharo@metalab.unc.edu. Please include the word "XOM" in the
20
// subject line. The XOM home page is temporarily located at
21
// http://www.cafeconleche.org/XOM/ but will eventually move
22
// to http://www.xom.nu/
23
package nu.xom;
24
25 import org.xml.sax.SAXException JavaDoc;
26
27 import com.sun.org.apache.xerces.internal.parsers.SAXParser;
28 import com.sun.org.apache.xerces.internal.parsers.DTDConfiguration;
29 import com.sun.org.apache.xerces.internal.impl.Constants
30 ;
31 /**
32  * <p>
33  * This class is used by the <code>Builder</code> to prevent the
34  * repackaged Xerces shipped with Java 1.5 and some of the JAXP
35  * reference implementations from accepting XML 1.1 documents.
36  * This is packaged and built separately from the normal classes to
37  * enable Java 1.4 and earlier compilers to handle this.
38  * </p>
39  *
40  * @author Elliotte Rusty Harold
41  * @version 1.0b2
42  *
43  */

44 class JDK15XML1_0Parser extends SAXParser {
45
46     JDK15XML1_0Parser() throws SAXException JavaDoc {
47       
48         super(new DTDConfiguration());
49         // workaround for Java 1.5 beta 2 bugs
50
com.sun.org.apache.xerces.internal.util.SecurityManager manager
51           = new com.sun.org.apache.xerces.internal.util.SecurityManager();
52         setProperty(Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY, manager);
53         
54     }
55
56 }
57
Popular Tags