/* Xml Hand-on Practice
From: Zhang Shaohua (hillfree@263.net)
Since: 2003-11-27 */

// Title: 003_如何从Xml文件创建一个XmlDocument对象



// java version

 try {
  // Create a builder factory
  DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  factory.setValidating(validating);
   
  // Create the builder and parse the file
  Document doc = factory.newDocumentBuilder().parse(new File(filename));
  } catch (SAXException e) {
  } catch (ParserConfigurationException e) {
  } catch (IOException e) {
  }



// C# version

 XmlDocument doc = new XmlDocument(); // see also Xml HandOn Practice (02)
 doc.Load(filename);

相关文章:

  • 2021-06-12
  • 2022-12-23
  • 2022-01-01
  • 2022-03-02
  • 2022-12-23
  • 2021-10-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2022-01-25
  • 2022-02-11
  • 2021-10-20
  • 2022-01-16
相关资源
相似解决方案