XML DOM
| From: | Ian Williams | Date: | Mon, 03 Nov 2003 14:17:40 +0000 |
| Subject: | XML DOM | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-168386@lists.php.net to get a copy of this message | ||
I have an XML document as a string $strXml, that looks a little like this:
<recordset>
<row>
<userid>1</userid>
<username>Bob</username>
<password>Rover</username>
</row>
<row>
<userid>2</userid>
<username>Fred</username>
<password>Fido</username>
</row>
</recordset>
What's the best way to grab a single value from this document? In the past
(in
VB), I have loaded the XML into a DOM Document, and used an XPath query to
select the data I want, and then bung the output into a string.
Any suggestions?
Thanks
Ian