473,322 Members | 1,538 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

XPath queries with Namespaces

I am having trouble writing an XPath query that deals with namespaces. I've
see the documentation that says that I have to use a XmlNamespaceManager and
qualify my queries such that they match up with the definitions added to the
XmlNamespacemanager, but I want to write a query that pulls all of the
elements from my document that would otherwise match the
expression--regardless of their namespace. Does anyone know how to do this?

Thanks,
Wells
Nov 12 '05 #1
2 1053
* Wells Caughey wrote in microsoft.public.dotnet.xml:
I am having trouble writing an XPath query that deals with namespaces. I've
see the documentation that says that I have to use a XmlNamespaceManager and
qualify my queries such that they match up with the definitions added to the
XmlNamespacemanager, but I want to write a query that pulls all of the
elements from my document that would otherwise match the
expression--regardless of their namespace. Does anyone know how to do this?


*[local-name() = "name"]

Selects all element children of the context node with a local-name
"name" regardless of their namespace.
Nov 12 '05 #2
Thank you so much, that is exactly what I need!

Wells

"Bjoern Hoehrmann" <bj****@hoehrmann.de> wrote in message
news:3f****************@news.bjoern.hoehrmann.de.. .
* Wells Caughey wrote in microsoft.public.dotnet.xml:
I am having trouble writing an XPath query that deals with namespaces. I'vesee the documentation that says that I have to use a XmlNamespaceManager andqualify my queries such that they match up with the definitions added to theXmlNamespacemanager, but I want to write a query that pulls all of the
elements from my document that would otherwise match the
expression--regardless of their namespace. Does anyone know how to do
this?
*[local-name() = "name"]

Selects all element children of the context node with a local-name
"name" regardless of their namespace.

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris | last post by:
Hi all, I have recently started working with the new XML functionality in PHP5, but I am running into a few problems. Specifically, I am using an Xpath query to try and pull out the data in...
1
by: gimme_this_gimme_that | last post by:
I have the following xml file and need some tips on xpath queries to fetch the data. I think I'm not handling namespaces correctly. Here is xml file : <?xml version="1.0"...
4
by: Gismo | last post by:
I have got file raport.rld which is an XML file generated by MS Reporting Services. The problem is: in this file are tags from two different namespaces ...
1
by: Hollywood | last post by:
I have the following XSD created in VS.NET 2003: <?xml version="1.0" encoding="utf-8" ?> <xs:schema id="ReferralSchama" targetNamespace="http://test.org/Referral"...
1
by: Robert | last post by:
I am having a problem selecting nodes using the XMLnodelist Selectnodes using XPATH when I use XML SPY is successfully queries but when is use VB.net it comes up with nothing. Here is my code ...
2
by: ree32 | last post by:
When I import an xml document in Visual studio and Genereate as schema from it, and create a dataset from it, it adds this line into to the root element of my xml file -...
10
by: Michael C# | last post by:
OK, here's the deal. I have a small XML file that represents a small database table. I load it into a System.XML.XMLDocument. So far so good. I run an XPath query against it to retrieve all the...
3
by: SD | last post by:
Hi, How can i get all the nodes with attribute Name = "Publisher" or Name="Administrator" using XPath query and C# for this xml doc? <GetRoleCollectionFromUser...
3
by: Jason Mobarak | last post by:
Hello -- I'm attempting to get a handle on how to do xpath queries with System.Xml -- so far the biggest hurdle has been how to deal with a default namespace. If I use the test xml: <?xml...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.