By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,990 Members | 2,324 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,990 IT Pros & Developers. It's quick & easy.

Namespace before attribute

P: n/a
Hi all,

I would like to select <Cell> nodes from XML file created by MS Excel:

<Cell ss:StyleID="s21"><Data ss:Type="Number">323166</Data></Cell>

Unfortunately there are namespaces ss: before attributes and the
kbFile.SelectNodes("//Cell/Data[@ss:Type='Number']", nsmgr) doesn't
return any result although I have added the namespace to
NamespaceManager:

Dim nsmgr = New XmlNamespaceManager(kbFile.NameTable)
nsmgr.AddNamespace("ss",
"urn:schemas-microsoft-com:office:spreadsheet")

I have tried to delete manually all namespaces and change Xpath to
"//Cell/Data[@Type='Number']" and everything worked OK. But I need to
process the file with namespaces. Where the trouble should be? There
are also another namespaces declared - I tried to Add them all to nsmgr
but withour succes. Is there any way to validate Xpath with included
namespaces?

Thanx a lot for reply!

Mar 29 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.