有没有办法通过系统属性打开/关闭xerces“功能”?

时间:2010-11-04 20:15:34

标签: xml

apache java xerces xml解析器具有许多控制解析器行为的功能(http://xerces.apache.org/xerces-j/features.html)。有没有办法通过设置java系统属性来打开或关闭这些?

1 个答案:

答案 0 :(得分:1)

根据JAXP 1.5 Documentation,有可能:

在那里找到以下示例:

  //allow resolution of external schemas

  System.setProperty("javax.xml.accessExternalSchema", "file, http");

   //this setting will affect all processing after it's set
   some processing here

   //after it's done, clear the property
   System.clearProperty("javax.xml.accessExternalSchema");