RSS feed
<< 2008년 12월 4일 (목) | Home | 2008년 12월 6일 (토) >>

XML Factory 를 위한 Property 셋팅 예제

XML Factory 를 설정을 위한 Property 셋팅 예제


통상 Classpath 문제로 인해 뜻하지 않은  Parser가 사용되는 경우가 있는 이때 명시적으로 원하는 factory를 지정하려면 아래 처럼 한다.



//     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");