This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | XPath construction in the XML editor | ||
---|---|---|---|
Product: | xml | Reporter: | fkieviet <fkieviet> |
Component: | Text-Edit | Assignee: | Samaresh Panda <samaresh> |
Status: | NEW --- | ||
Severity: | blocker | ||
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
fkieviet
2007-12-17 19:09:57 UTC
Do you have an implementation suggestion for it? I also thought about it but there is an indefinite number of possible XPathes which would match on the same element/ attribute. Example: <root> <element1 /> <element2 /> <!--- this is assumed to be the selected one --> <element2 /> </root> Some possibilities: /root/*[2] /root/element2[1] //element2[1] Indeed, there are multiple expressions leading to the same result. I think the most restrictive expression would be best. In your example, it would be /root/element2[1]. If schema information can be used: if the multiplicity of element2 is 1, the [1] can be dropped. If no schema info can be used, the absence of a duplicate element2 can be used to drop the [1] index. I don't expect the expression generator to be perfect, but it'll likely be good enough in 90% of the cases. Not sure who is spanda. Assigned to myself. |