Page 1 of 1

XPathBuilder xpath does not include attributes on caret move

Posted: Tue Oct 07, 2008 12:45 am
by csalsa
The attribute for a XML element is not included in the 'Expression' box of the 'XPath Builder' when the attributed is selected and the XPath Builder is configured for 'XPath update on caret move'. The problem occurs for XPath 1.0 and 2.0.

Elements are updated in the 'Expression' box correctly.

The xpath should have 'xsi:type' attributes for intermediate element nodes where 'xsi:type' has been used. Otherwise the xpath is not correct.

Re: XPathBuilder xpath does not include attributes on caret move

Posted: Tue Oct 07, 2008 12:14 pm
by sorin_ristache
Hello,

We will consider adding an option in the configuration of the XPath toolbar for adding the xsi:type attribute to the expression that is placed in the XPath expression field when the toolbar is in the mode 'XPath update on caret move'.


Thank you for your suggestion,
Sorin

Re: XPathBuilder xpath does not include attributes on caret move

Posted: Wed Oct 08, 2008 11:47 pm
by csalsa
Hi Sorin
csalsa wrote:The attribute for a XML element is not included in the 'Expression' box of the 'XPath Builder' when the attributed is selected and the XPath Builder is configured for 'XPath update on caret move'. The problem occurs for XPath 1.0 and 2.0.
Are you planning to fix the XPath in the 'Expression' box?

Consider:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<document>
<chapter pageNumber="3" />
</document>
From the above code the 'Expression' box displays /document/chapter regardless if the element 'chapter' is selected or the attribute 'pageNumber' is selected. For the latter, the 'Expression' box should show /document/chapter/@pageNumber

Re: XPathBuilder xpath does not include attributes on caret move

Posted: Thu Oct 09, 2008 11:39 am
by tavy
Hi,

I added this to our bug tracking tool so it will probably be implemented in a future version.
I think there must have been a performance issue to also determine the attribute, otherwise it would have been implemented from the beginning.

Regards,
Adrian Buza
http://www.oxygenxml.com

LE:
Sorry for the mistake, my colleague Octavian was already logged in, and I didn't notice.

Re: XPathBuilder xpath does not include attributes on caret move

Posted: Mon Oct 13, 2008 12:13 am
by csalsa
Thanks tavy for your reply.