Originally posted by Black Lung
stupid question...i was wondering how do you run queries on XML stuff?
Well typically you don't want to do MAJOR searching on an xml document. You want to do the primary data mining in the database itself. Any xml handed off to the webserver or the client should be a subset that can be easily handled by the webserver or the client.
Caveat: I am talking from an MSXML perspective but I believe in its general sense this should carry over to non Microsoft xml parsers as well.
The syntax used is xpath. You implement it two ways, most commonly and fastest is within an xsl transform as the xml parsing engine is optimized to handle it in that manner. You can also act on the xml document directly with the xml DOM.
<node id="1" />
<node id="2" />
If you wanted to find the node with id="2", you would do it in two ways.
<xsl:value-of select = "node[@id
oNode = oXMLDOM . DocumentElement . SelectSingleNode ("node[@id
I could wax poetic about xml if allowed.