vscode-xml icon indicating copy to clipboard operation
vscode-xml copied to clipboard

XPath command does not display resulting xml results

Open wakeboarder3780 opened this issue 8 years ago • 6 comments

I will reference the BNF grammar below to make the description of the issue as precise as possible:

[39] element ::= EmptyElemTag | STag content ETag [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*

In general terms the BNF grammar for xml defines that an element is defined as a "start tag" followed by some "content" followed by an "end tag".

When executing the xpath command where the resulting element's content is "CharData", the results are displayed accurately.

However when executing the xpath command where the resulting element's content is another "element" the results take an odd display form. It appears to be a value printout instead of displaying the snippet of xml.

Consider the sample xml:

<giftBasket>
    <apple>Macintosh</apple>
    <apple>Granny Smith</apple>
    <oranges>
        <origin>florida</origin>
        <quantity>3</quantity>
    </oranges>
</giftBasket>

If you run an xpath on //apple you will get the following for the displayed results (good): [Line 2] apple: Macintosh [Line 3] apple: Granny Smith

However if you run an xpath on //oranges you will get the following odd result displayed (bad): [Line 4] oranges: florida 3

What I think should be displayed is: [Line 4] oranges:

<oranges>
        <origin>florida</origin>
        <quantity>3</quantity>
 </oranges>

I will say it would also be nice if the results initially just displayed as a list of results that were collapsed with pluses on the left hand side of each result. Clicking the plus itself would show the snippet of xml where as clicking anywhere else in the row that is displaying the line number would bounce the cursor to that line number in the file. In this way the results pane for the xpath expression would be very useful.

wakeboarder3780 avatar May 16 '17 20:05 wakeboarder3780

Hello, I have the same problem. It will be useful to diplay the results as an xml tree. Will this issue be treated ?

Thank you

chebilhajer avatar Jun 11 '18 11:06 chebilhajer

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 14 '18 16:12 stale[bot]

Same here. You see no results if the XML is without any text inside elements (just nodes and attributes).

zbynekbotlo avatar Jan 02 '19 12:01 zbynekbotlo

+1 for this issue. It should be possible to see the actual xml results of the xpath expression. It would be particular awesome to have the results displayed as tree view also.

ericchaves avatar Sep 06 '19 12:09 ericchaves

I have the same issue. Only the line numbers show up for the results of the XPath evaluation.

Is there any update?

aditp91 avatar Nov 01 '19 20:11 aditp91

still an issue...

tkazik avatar Sep 24 '21 09:09 tkazik