[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xmlblaster] XML parser



Hi,
may I be a little dogy.

As far as I can see the XML parser loading in XmlBlaster is done in
XmlProcessor where com.jclark.xsl.dom.SunXMLProcessorImpl(). It uses the
com.sun.xml.parser.Parser to get at the parser. If I get it correct this
however uses the JAXP API to get its real parser: i.e if this is set to
xerces, or if xerces had the chance to load before crimson, xerces will
be the parser used through SunXMLProcessorImpl. Since XmlBlaster uses
crimson specific stuff to do important stuff this is not so good. I once
wrote a helper for this:

public class CrimsonProcessorImpl extends com.jclark.xsl.dom.XMLProcessorImpl  {

    DocumentBuilderFactory dbf = null;
    
    public CrimsonProcessorImpl() {
	dbf = new org.apache.crimson.jaxp.DocumentBuilderFactoryImpl();
    }
    
    public org.w3c.dom.Document load(org.xml.sax.InputSource input)
	throws java.io.IOException, org.xml.sax.SAXException {
	DocumentBuilder db = null;
	try {
	    db = dbf.newDocumentBuilder ();
	}catch(javax.xml.parsers.ParserConfigurationException ex) {
	    throw new org.xml.sax.SAXException("Could not setup builder", ex);
	}
	return db.parse(input);

    }
	
    public org.w3c.dom.Element getElementById(org.w3c.dom.Document doc, String str) {
	return null;
    }
}

And used that from XmlProcessor. But I guess mine is not as effective as
yours. Any ideas on how to solve this would be great.

//Peter
-- 
------------------------------------------------------------
Peter Antman	Chief Systems Architect, Business Development
Technology in Media, Box 34105 100 26 Stockholm
WWW: http://www.tim.se	WWW: http://www.backsource.org
Email: pra at tim.se	 
Phone: +46-(0)8-506 381 11 Mobile: 070-675 3942 
------------------------------------------------------------