The XML parsing method.
XML Parsing Method
1. DOM generation and parsing XML
2. Generate and parse XML using SAX
3. DOM4J generation and parsing XML
4. JDOM generation and parsing XML
C # How to parse XML
DataSet ds = new DataSet ();
Ds. ReadXml ("your xml file path ");
The ReadXml method of DataSet can be used to read data in XML to DataSet as a DataTable.
You can also use
XmlDocument xml = new XmlDocument ();
Xml. Load (System. Windows. Forms. Application. StartupPath + "\ SystemSet. xml ");
XmlNodeReader read = new XmlNodeReader (xml. SelectSingleNode ("SystemSet "));
While (read. Read ())
{
If (read. NodeType = System. Xml. XmlNodeType. Element)
{
Read. Read ();
If (read. NodeType = System. Xml. XmlNodeType. Text)
{
Read. Value;
}
}
}
System. Xml. XmlNodeType there will be a lot of attributes at the bottom. You can see that it is helpful to you.
Hope to help you
Php xml Parsing Method
There are three main methods:
1. Use the DOM library to read XML
2. Read XML with a SAX Parser
3. parse XML using regular expressions
For more information, see the IBM developer documentation library www.ibm.com/..omphp/