Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML 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:21 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 Schema

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
schema stops stylesheet from working? stekker XSLT 4 June 15th, 2006 02:02 PM
Schema to Schema conversion onlyda XSLT 5 March 23rd, 2006 12:25 PM
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 defaultbn mokka°logic C# 0 September 10th, 2003 01:28 PM





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