| Summary: | add nodes' XPath | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Zohar Amir <david_fire4> |
| Component: | WTP Incubator | Assignee: | Doug <doug.satchwell> |
| Status: | RESOLVED FIXED | QA Contact: | David Williams <david_williams> |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | david_williams, doug.satchwell, d_a_carver, thatnitind |
| Version: | unspecified | Keywords: | helpwanted |
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Zohar Amir
I'm assuming you'd like us to contruct a 'representative' XPath for the node. Can you add som more information about the use case you have in mind and how this information would be helpful? I'd like to know how this enhancements fits into the big picture of what you're trying to accomplish. Thanks for your help! I need the XPath mainly to communicate with other software and people. For example, if I have a non-trivial document and I want to say something about a certain node (e.g., it holds a wrong value), I would like to do that in an unequivocal manner. (In reply to comment #0) > add a node's XPath to its properties this could also be handy when writing XQueries or XSL Transforms on the XML file Is a node's properties really a good place to put an XPath? In many cases it could work, but in documents that use the default namespace you cannot create a "nice" XPath to a node and is left with something that would look like "/*[local-name()='root']/*[local-name()='a']/*[local-name()='b']" which is verbose and ugly - or "/*[1]/*[2]/*[1]" which is probably not that helpful either. This is due to the fact that in XPath, a prefix-less node name such as /a always means the node must be in no namespace. Perhaps a separate view for XPath support would be in order - for example, what is an appropriate namespace context to use - the namespaces in scope for the node, or the ones in scope for the document element? It depends on the use case, and in a view you could have a mechanism to set or alter the namespace context. The same goes for the context node - in XSLT, for example, you will typically want an XPath from your current evaluation context to some selected node, instead of an absolute path. You could set or change the context node if it was a separate view. Setting as help wanted. Unless this is covered by the incubating XSLT enhancements, we won't have time to work on it just now. Actually, I have created an XPath view that displays the current document location e.g. if you click on a particular element in the XML editor, the view displays (one of the) xpaths to that node e.g. /root/to/my[3]/node - is this enough? Yep, sounds good (at least to me). Do you have any screen shots or anything? I think the best thing to do is wait for Ganymede M6 to arrive and download the M6 version of XSL from http://www.eclipse.org/webtools/incubator/downloads/ M6 should be in about 6 weeks time I think. I suggest moving this to the XSL Incubator project. The XPath View and XPath Navigators that Doug mentions are available in 0.5M5 of the xsl tooling project. You can download a zip from: http://www.eclipse.org/webtools/incubator The next milestone is scheduled for April 7th. Zohr and Steen have you checked out the XSL Tooling incubator project. It includes an XPath view, that is linked to the XML Editor. It will show you what the XPath is for the current cursor position. Looks good. 1. Is there some explanation on how to work with this feature? 2. Whene standing on an attribute the xpath is not shown (the enclosing element's xpath is shown for a brief moment and then disappears) - is that a bug? (In reply to comment #11) > Looks good. > 1. Is there some explanation on how to work with this feature? That is currently being developed. > 2. Whene standing on an attribute the xpath is not shown (the enclosing > element's xpath is shown for a brief moment and then disappears) - is that a > bug? Probably a bug, if you can please open a separate bug report for this. Have fixed the bug with attribute nodes. Thanks again. Where can I download the fix? (In reply to comment #14) > Thanks again. > Where can I download the fix? > It'll be available in our next Milestone release. Which is tentatively planned for May 7th. Unfortunately we don't currently have a public weekly integration site yet. Verfied in latest IBuild20080430. Zohar, please check 0.5M7 when it is available in a couple of weeks. Marking this as resolved. |