如何解析xml以将其插入到mysql数据库中?

How would I parse a very large xml file and insert it into a mysql database? I know PHP and I know javascript

If it's a very large XML file you might not want to use DOM / SimpleXML as these load the complete XML tree into memory before allowing you to do any manipulation. If you are only interested in read operations you might want to look at XMLReader http://www.php.net/manual/en/class.xmlreader.php

XMLReader works by reading node by node, thus keeping speed up and memory usage down. There are a few interesting examples in the PHP documentation.

You can also look at SAX, an event based parser: http://php.net/xml_parser_create

You would use an XML parser such as SimpleXML.

$xml = simplexml_load_string($yourXml);

// Do what you need to do...

Another way (for MySQL 5.5) is a LOAD XML statement.