Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > Pro VB.NET 2002/2003
|
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 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:31 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 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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Transformation not working with a specific xmlns sunrain XSLT 3 October 30th, 2008 12:14 PM
XMLNS mathias XML 0 February 20th, 2007 04:46 AM
xmlns albusr .NET Web Services 0 December 24th, 2005 08:25 AM
XPathExpression.AddSort not working with defaultbn mokka°logic C# 0 September 10th, 2003 01:28 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.