Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 10th, 2003, 01:28 PM
Registered User
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mokka°logic
Default XPathExpression.AddSort not working with defaultbn

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.

Similar Threads
Thread Thread Starter Forum Replies Last Post
window.opener working .... not working alyeng2000 Javascript How-To 5 January 5th, 2007 08:05 AM
Web.Config..Working or Not Working peace95 ASP.NET 1.0 and 1.1 Basics 1 September 18th, 2006 06:53 AM
Local COM working , but not working at Web Serv nagen111 .NET Web Services 3 February 19th, 2005 04:22 AM
XPathExpression.AddSort not working with xmlns mokka°logic Pro VB.NET 2002/2003 0 September 10th, 2003 01:31 PM
XPathExpression.AddSort not working with Schema mokka°logic XML 0 September 10th, 2003 01:21 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.