473,394 Members | 1,714 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,394 software developers and data experts.

XPathExpression.AddSort not working with xmlns

Hi there,
don't know whether anyone ran into this issue formerly
(in .NET 1.0).

I have an XML document with a default namespace
(indicating the target namespace of the XML Schema used to
validate the document):

<ObjectIndex
xmlns="http://ref.devlink.net/opal/runtime/ObjectBaseSchema
..xsd">

Adding the default namespace to an XmlNamespaceManager
with a bogus prefix and prefixing element and attribute
names in XPathExpressions is the only way that works to
evaluate and search with XPathNavigator on documents that
have such a default namespace applied, which is annoyingly
enough.
What's more, trying to sort the selected nodes using the
XPathExpression.AddSort method doesn't seem to work when a
default namespace exists - simply NO nodes at all are
returned!
Using the bogus namespace prefix within the sort key
works, if (and only if) the namespace manager has been
added to the XPathExpression twice (!) - before and after
the .AddSort () statement. Moreover, although now the
selected nodes are returned correctly, the desired sorting
is simply NOT applied to the resultant node set!!
What am I missing here? Is this a framework bug? I don't
want to remove the default namespace - I need it for
validation and when selecting with XPath, I use the
performant, but read-only XPathDocument rather than the
DOM-Document...

Any help would be greatly appreciated.
Best, Philipp
Nov 15 '05 #1
0 1384

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

Similar topics

1
by: DN | last post by:
I'd like to pass multiple attributes to XPath AddSort like: expr = nav.Compile(strQuery); expr.AddSort(sortArray, XmlSortOrder.Ascending, XmlCaseOrder.None, "", XmlDataType.Text); But I get...
2
by: Steve Taylor | last post by:
Is there some reason why I shouldn't be able to use the same XPathExpression simultaneously in multiple iterations? The test below illustrates the problem. It seems that creating two...
4
by: gajba | last post by:
Hi, from an XML beginner.. I have an XML like the one below: <root> <vendor name="Microsoft"> <!-- additional sub-tags and items --> </vendor> <vendor name="Sun"> <!-- additional sub-tags...
4
by: viditmittal | last post by:
hi, i have a xml file <root> <Type /> <Description /> <Category /> <employee > <id>3</id>
0
by: LockyBoy | last post by:
Hi Have created an xml document with an xmltextwriter with a namespace, so it can be validated against an xsd schema. Later in my application, I want to extract values from the xml and am using...
1
by: DN | last post by:
I'd like to pass multiple attributes to XPath AddSort like: expr = nav.Compile(strQuery); expr.AddSort(sortArray, XmlSortOrder.Ascending, XmlCaseOrder.None, "", XmlDataType.Text); But I get...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
2
by: darrel | last post by:
I have an XML file that looks like this: <Counties> <County> <District>2</District> <CountyName>Palm</CountyName> </County> <County> <District>3</District> <CountyName>McCarthy</CountyName>
1
by: monsalvo | last post by:
Hello. I've just coded a VBScript SOAP Client to send requests to a web service in our intranet. It's working and we'll use it in a DTS cuz we have not implemented SQL Server 2005 yet. Anyway. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.