The problem here is that the factory knows nothing about the parsers it 
creates yet is required to throw an exception if the attribute specified 
isn't recognized. This is why it creates one each time you set an 
attribute on the factory. It's really ugly though I don't see a way around 
it. A different parser configuration could be selected at any point 
completely changing which features/properties are recognized.

Curtiss Howard <[EMAIL PROTECTED]> wrote on 12/17/2004 10:57:10 AM:

> On Fri, 17 Dec 2004 10:31:57 -0500, Rick Bullotta
> <[EMAIL PROTECTED]> wrote:
> > Yup.  It's a concern.  Best way around it we've found is to set a 
bunch of
> > system properties to shortcut the factory creation process as in:
> > 
> > System.setProperty("javax.xml.transform.TransformerFactory",
> > "org.apache.xalan.processor.TransformerFactoryImpl");
> > System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
> > "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
> > System.setProperty("javax.xml.parsers.SAXParserFactory",
> > "org.apache.xerces.jaxp.SAXParserFactoryImpl");
> > 
System.setProperty("org.apache.xerces.xni.parser.XMLParserConfiguration",
> > "org.apache.xerces.parsers.XML11Configuration");
> > 
> > Rick Bullotta
> > CTO
> > Lighthammer Software (http://www.lighthammer.com)
> > 
> 
> Rick,
> 
> Thanks for the reply.  I'm not sure if this is my problem though --
> I've not seen speed issues with creating the DocumentBuilderFactory,
> but rather in setting features/properties such as
> 
> http://java.sun.com/xml/jaxp/properties/schemaLanguage,
> http://java.sun.com/xml/jaxp/properties/schemaSource,
> http://apache.org/xml/properties/internal/grammar-pool,
> etc.
> 
> (BTW, I realize that I am setting some Xerces-specific properties
> while at the same time trying to use JAXP interfaces.  My problem
> would go away if I were to use only Xerces's DOMParser/SAXParser
> classes, but I don't want to tie myself to a specific parser library).
> 
> 
> Curtiss Howard
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to