neilg 2003/01/17 15:53:33 Modified: java/docs samples-xni.xml Added: java/samples/xni xerces.properties Log: at the suggestion of some people in Xalan-land, here is a sample xerces.properties to use, along with some directions on where to put it and why it might be useful. Revision Changes Path 1.6 +42 -0 xml-xerces/java/docs/samples-xni.xml Index: samples-xni.xml =================================================================== RCS file: /home/cvs/xml-xerces/java/docs/samples-xni.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- samples-xni.xml 11 Sep 2002 14:12:22 -0000 1.5 +++ samples-xni.xml 17 Jan 2003 23:53:33 -0000 1.6 @@ -42,6 +42,10 @@ <li><link anchor='PSVIConfiguration'>xni.parser.PSVIConfiguration</link></li> <li><link anchor='PSVIParser'>xni.parser.PSVIParser</link></li> </ul> + <p>Sample xerces.properties</p> + <ul> + <li><link anchor='xercesProperties'>xni/xerces.properties</link></li> + </ul> <p> Most of the XNI samples have a command line option that allows the user to specify a different XNI parser configuration to use. In @@ -408,5 +412,43 @@ </p> <source>java sax.Counter -v -s -p xni.parser.PSVIParser personal-schema.xml</source> <note><link idref='features' anchor="validation">Validation</link> and <link idref='features' anchor="validation.schema">schema validation</link> features must be set to true to receive the correct PSVI output.</note> + </s2> +<anchor name='xercesProperties'/> + <s2 title='Sample xni/xerces.properties'> + <p> When you create a Xerces parser, either directly using a native + class like org.apache.xerces.parsers.DOMParser, or via a + standard API like JAXP, Xerces provides a dynamic means of + dynamically selecting a "configuration" for that parser. + Configurations are the basic mechanism Xerces uses to decide + exactly how it will treat an XML document (e.g., whether it + needs to know about Schema validation, whether it needs to be + cognizant of potential denial-of-service attacks launched via + malicious XML documents, etc.) The steps are fourfold: + </p> + <ol> + <li> * first, Xerces will examine the system property + org.apache.xerces.xni.parser.XMLParserConfiguration; + </li> + <li> next, it will try and find a file called xerces.properties in + the lib subdirectory of your JRE installation; + </li> + <li> next, it will examine all the jars on your classpath to try + and find one with the appropriate entry in its + META-INF/services directory. + </li> + <li>if all else fails, it will use a hardcoded default. + </li> + </ol> + <p> The third step can be quite time-consuming, especially if you + have a lot of jars on your classpath and run applications which + require the creation of lots of parsers. If you know you're + only using applications which require "standard" API's (that + is, don't need some special Xerces property), or you want to + try and force applications to use only certain Xerces + configurations, then you may wish to copy this file into your + JRE's lib directory. We try and ensure that this file contains + the currently-recommended default configuration; if you know + which configuration you want, you may substitute that class + name for what we've provided here.</p> </s2> </s1> 1.1 xml-xerces/java/samples/xni/xerces.properties Index: xerces.properties =================================================================== # # The Apache Software License, Version 1.1 # # # Copyright (c) 2003 The Apache Software Foundation. All rights # reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with the # distribution. # # 3. The end-user documentation included with the redistribution, # if any, must include the following acknowledgment: # "This product includes software developed by the # Apache Software Foundation (http://www.apache.org/)." # Alternately, this acknowledgment may appear in the software itself, # if and wherever such third-party acknowledgments normally appear. # # 4. The names "Xerces" and "Apache Software Foundation" must # not be used to endorse or promote products derived from this # software without prior written permission. For written # permission, please contact [EMAIL PROTECTED] # # 5. Products derived from this software may not be called "Apache", # nor may "Apache" appear in their name, without prior written # permission of the Apache Software Foundation. # # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR # ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # ==================================================================== # # This software consists of voluntary contributions made by many # individuals on behalf of the Apache Software Foundation and was # originally based on software copyright (c) 1999, International # Business Machines, Inc., http://www.apache.org. For more # information on the Apache Software Foundation, please see # <http://www.apache.org/>. # # @author Neil Graham # @version $Id: xerces.properties,v 1.1 2003/01/17 23:53:33 neilg Exp $ ########################################## # When you create a Xerces parser, either directly using a native # class like org.apache.xerces.parsers.DOMParser, or via a # standard API like JAXP, Xerces provides a dynamic means of # dynamically selecting a "configuration" for that parser. # Configurations are the basic mechanism Xerces uses to decide # exactly how it will treat an XML document (e.g., whether it # needs to know about Schema validation, whether it needs to be # cognizant of potential denial-of-service attacks launched via # malicious XML documents, etc.) The steps are threefold: # # * first, Xerces will examine the system property # org.apache.xerces.xni.parser.XMLParserConfiguration; # * next, it will try and find a file called xerces.properties in # the lib subdirectory of your JRE installation; # * next, it will examine all the jars on your classpath to try # and find one with the appropriate entry in its # META-INF/services directory. # * if all else fails, it will use a hardcoded default. # # The third step can be quite time-consuming, especially if you # have a lot of jars on your classpath and run applications which # require the creation of lots of parsers. If you know you're # only using applications which require "standard" API's (that # is, don't need some special Xerces property), or you want to # try and force applications to use only certain Xerces # configurations, then you may wish to copy this file into your # JRE's lib directory. We try and ensure that this file contains # the currently-recommended default configuration; if you know # which configuration you want, you may substitute that class # name for what we've provided here. org.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.IntegratedParserConfiguration
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]