|
top
|
 Subject: Copy Xpath Query to Clipboard Author: Matt Dawson Date: 22 Jun 2006 07:27 AM
|
Hi,
>1) Why not just put the Xpath right in the query box at the
>top of the screen? Or maybe make a separate context menu
>item for this?
I think this is a request for a feature I'd like to see, but I'm not quite sure. There are a few ways I can see to interpret this:
a) The Copy XPath Query to Clipboard feature that is now on the right click menu in the tree view.
b) Keep a path text field open at the top of the screen, and update it as you click around an XML document. This would be like keeping the Address bar open in Windows Explorer (and ideally should be an optional toolbar, just like in Explorer). Or like the feature in XPath Explorer (http://sourceforge.net/projects/xpe), when you double click on part of an XML document.
c) When opening the XPath Query Editor by right clicking on an item in the tree view, prepopulate the Query tab with the XPath statement to find the current element/node.
b) and c) are both things I'd like to see implemented.
>2) How about another context menu item that give you the
>choice of an "absolute" or not Xpath? Sorry if there is a
>better term - but you generate specific or absolute Xpath
>queries now - i.e. you embed the [1] in each level of the
>xpath statement. If I want to get all the items, then I have
>to remove each of the [1] statements.
This is something else I'd like to see added. e.g. I just used the right click option mentioned above on a document I'm working with, and it returned:
/Transmission/TransmissionBody[1]/GLogXMLElement[1]/PlannedShipment[1]/Shipment[1]/ShipUnit[2]/ShipUnitRefnum[7]/ShipUnitRefnumQualifierGid[1]/Gid[1]/Xid[1]
This is an absolute path to the current element instance, but sometimes we want the path to the level in the structure rather than a specifc instance. Ideally I'd like to see an option to return something like this instead:
/Transmission/TransmissionBody/GLogXMLElement[*]/PlannedShipment/Shipment/ShipUnit[*]/ShipUnitRefnum[*]/ShipUnitRefnumQualifierGid/Gid/Xid
Another aspect of the preferred output above - it does not include unnecessary array elements in the XPath generated. i.e. Stylus currently outputs /Transmission/TransmissionBody[1] ... even though the TransmissionBody element has a max/min occurs of 1, so specifying [1] to indicate the instance of that element is unnecessary. Even if the option to generate a non-"absolute path" is not added to the product, I still tend to think these unnecessary/irrelevant array elements should be removed from the generated XPath.
Any chance any of these might make it into a future update/release?
Thanks,
Matt
|
|
|