IBM®
跳转到主要内容
    中国 [选择]    使用条款
 
 
Select a scope: Search for:    
    首页    产品    服务与解决方案     支持与下载    个性化服务    
跳转到主要内容

developerWorks 中国  >  XML  >

Tip: Achieving vendor independence with SAX

How to use SAX and a SAX helper class to achieve vendor independence

developerWorks

Return to article


Using the XMLReaderFactory with Java system properties (parser independent)
        
// Obtain an instance of an XMLReader implementation from a system property
XMLReader parser = org.xml.sax.helpers.XMLReaderFactory.createXMLReader();
// Do normal parsing tasks
parser.setContentHandler(new MyContentHandler());
parser.parse(new InputSource("file:///usr/local/projects/xml/test.xml");
      

Return to article

    关于 IBM 隐私条约 联系 IBM 使用条款