Tools XML Inspector and XPath Generator/en

Aus expecco Wiki (Version 25.x)
Zur Navigation springen Zur Suche springen

This tool presents an XML document's DOM tree elements. Its most useful function is the XPath input field and XPath generator.

Enter an XPath expression into the field to see which nodes are selected, or vice versa, select an element to get an XPath which finds that element.

In the following, a simple XML document is used as example input:

<DOC>
 <ITEM>
   <REVENUE_YEAR>2554-02</REVENUE_YEAR>
   <REGION>Central</REGION>
   <COST>100</COST>
 </ITEM>
 <ITEM>
   <REVENUE_YEAR>2552-02</REVENUE_YEAR>
   <REGION>Central</REGION>
 </ITEM>
 <ITEM>
   <REVENUE_YEAR>2552-03</REVENUE_YEAR>
   <REGION>Central</REGION>
   <COST>400</COST>
 </ITEM>
 <ITEM>
   <REVENUE_YEAR>2552-04</REVENUE_YEAR>
   <REGION>West</REGION>
   <COST>100</COST>
 </ITEM>
 <ITEM>
   <REVENUE_YEAR>2552-05</REVENUE_YEAR>
   <REGION>East</REGION>
   <COST>200</COST>
 </ITEM>
 <ITEM>
   <REVENUE_YEAR>2552-06</REVENUE_YEAR>
   <REGION>East</REGION>
   <COST>300</COST>
 </ITEM>
</DOC>

Opening the XML Inspector

As described elsewhere, the inspector can be opened via the pin-value popup menu, programmatically or via an action from the standard library. It is also embedded into a FileBrowser when an XML document file is double clicked or selected inside a zip archive there.

Finally, the regular inspector also contains a DOM tab if the inspected string represents an XML document.

Programmatically, execute (in a workspace or in a code editor, select an doIt):

|text|
text := '<DOC> .... </DOC>'.
text inspect

or:

'<DOC>...</DOC>' inspect

or in JavaScript:

var text;
text = "<DOC> .... </DOC>".
text.inspect()

or:

"<DOC>...</DOC>".inspect()
Opening Inspector in Workspace
Fehler beim Erstellen des Vorschaubildes: Die Miniaturansicht konnte nicht am vorgesehenen Ort gespeichert werden
XML Inspector showing the DOM

Back to Online Documentation.
Back to Tools.



Copyright © 2014-2024 eXept Software AG