xmlns="http://data.usgs.gov/mag/1.0"
or
xmlns="http://data.usgs.gov/mag/2.0"
or
xmlns="http://data.usgs.gov/dec/2.8"
These are examples and there could be many more.The data is more or less in
the same format as far as nodes and node names but how do I account for the
various namespaces. I will not know these ahead of time so was hoping there
was a way to parse these out of the header.
tia
AGP
http://msdn.microsoft.com/en-us/library/system.xml.xmlelement.namespaceuri.aspx
--
Joe Fawcett (MVP - XML)
http://joe.fawcett.name
"AGP" <sindiz...@softhome.net> wrote in message
news:vDZ2m.3331$bq1...@nlpi066.nbdc.sbc.com...
Do you use LINQ to XML to deal with the XML? If so then you can simply do
Dim doc As XDocument = XDocument.Load("file.xml")
Dim ns As XNamespace = doc.Root.Name.Namespace
to get an XNamespace object, assuming the default namespace is defined
on the root element of your XML documents.
Then you can use that XNamespace object ns when trying to select
elements e.g.
Dim query = _
From foo In doc.Descendants(ns + "foo") _
...
The nice thing is that the approach even works if the root element has
no namespace declaration so you don't have to change the code if you
need to deal with different documents where some have a namespace and
some do not have one.
--
Martin Honnen --- MVP XML
http://msmvps.com/blogs/martin_honnen/
AGP
Abel
"Joe Fawcett" <joefa...@newsgroup.nospam> wrote in message
news:%23Nyts8u%23JHA...@TK2MSFTNGP02.phx.gbl...