At 02:49 23/01/2003 +0000, you wrote:
> don't know much about this. Have a look at www.php.net/domxml[EMAIL PROTECTED] (Lukasz Karapuda) wrote:>Hello. > >I am in the process of migrating from a Win2000+ASP+MSSQL Server 2000 web >environment to a Win2000+PHP+MSSQL Server environment. >1. Session Handling. yes >2. MSSQL Server access / ODBC access to MySQL server. yes. There are performance problems with access to remote MSSQL servers (see e.g. http://bugs.php.net/bug.php?id=21772). Why do you want to access mysql over ODBC? The native API is much more powerful... >3. E-mail sending functionality. Yes >4. DOM XML parser.
This (DOM XML) works just as expected (though get the *latest* version of PHP you can find to ensure most of the bugs have been worked out) DOM implementations are requireds to provide certain standardised functionality though the syntax might be language specific the actual results from a gived piece of code should not : Heres an example chunk I've worked on this week :
if ($xmldoc=xmldoc($fields->data)) {
// Get some XML data from the database : $fields is a retrieved recordset object
// If statement ensures the xmldoc could be read and parsed if xmldoc() returns true)
$context=xpath_new_context($xmldoc);
// Set up your context (document) reference for XPth to work with
$root=$xmldoc->root();
// This is my document root (obviously !)
$nodepath="/scenes";
// OK - top level node called scenes - this is an XPath expression
$result=xpath_eval($context,$nodepath);
// Evaluate the Xpath against the document specified above
$scenes=$result->nodeset[0];
// This is your nodeset - its an array of objects (nodes)
print(domxml_get_attribute($scenes,"description"));
// Get an attribute
print($scenes->content);
// Get the text of a node
} else {
print("Error : Document was not valid XML");
}
So this would parse out the following description attribute from this document :
<scenes description="my scene description">
Act one scene one
</scenes>
and print
My scene description
Act one scene one
Cheers,
Neil Smith
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php