
On Sat, 22 Jan 2005 oxygen-user-request@oxygenxml.com wrote:
Date: Sat, 22 Jan 2005 18:23:02 +0200 From: Sean Wheller <sean@enbaya.co.za> Subject: [oXygen-user] complex xpath
Using the following document as a study http://www.gnome.org/~shaunm/doctable/doaproll.rdf
My question is how to perform an XPath that will return all CVSRepository nodes. I try //CVSRepository and get "XPath returned no results".
Any hints should be documented and added to Oxygen Help.
The problem is an XPath one and not an oXygen one. In your XML document, each "<Project>" element is assigned to a namespace without a prefix, making it impossible to find its subelements using XPath. Try adding this attribute to your root RDF element: xmlns:prj="http://www.gnome.org/~shaunm/faux-doap" then you can use the XPath expression //prj:CVSRepository and find the elements. DS -- David Sewell, Editorial and Technical Manager Electronic Imprint, The University of Virginia Press PO Box 400318, Charlottesville, VA 22904-4318 USA Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903 Email: dsewell@virginia.edu Tel: +1 434 924 9973

Hi Sean, David, We added support for defining in options proxy to namespace mappings that will take precedence over the ones defined in the document so basically now any namespace can be accessible via a proxy without the need to define that proxy in the document. The current version of oXygen (5.1) detects a default namespace and maps that to the first available proxy from {default, default1, etc.} but in the case Sean mentioned default:CVSRepository does not work because there is another default namespace for an element before the CVSRepository element and default is mapped to that. Best Regards, George --------------------------------------------------------------------- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com David Sewell wrote:
On Sat, 22 Jan 2005 oxygen-user-request@oxygenxml.com wrote:
Date: Sat, 22 Jan 2005 18:23:02 +0200 From: Sean Wheller <sean@enbaya.co.za> Subject: [oXygen-user] complex xpath
Using the following document as a study http://www.gnome.org/~shaunm/doctable/doaproll.rdf
My question is how to perform an XPath that will return all CVSRepository nodes. I try //CVSRepository and get "XPath returned no results".
Any hints should be documented and added to Oxygen Help.
The problem is an XPath one and not an oXygen one. In your XML document, each "<Project>" element is assigned to a namespace without a prefix, making it impossible to find its subelements using XPath. Try adding this attribute to your root RDF element:
xmlns:prj="http://www.gnome.org/~shaunm/faux-doap"
then you can use the XPath expression
//prj:CVSRepository
and find the elements.
DS
participants (2)
-
David Sewell
-
George Cristian Bina