Tools XML Inspector and XPath Generator/en: Unterschied zwischen den Versionen

Aus expecco Wiki (Version 25.x)
Zur Navigation springen Zur Suche springen
Inhalt gelöscht Inhalt hinzugefügt
Zeile 44: Zeile 44:
inspected string represents an XML document.
inspected string represents an XML document.


Programmatically, execute (in a workspace or in a code editor, select an ''doIt''):
Programmatically, (try it in a workspace or a code editor, by selecting the expression and executing it with ''doIt''):
|text|
|text|
text := '<DOC> .... </DOC>'.
text := '<DOC> .... </DOC>'.
Zeile 58: Zeile 58:


[[Datei:openXMLInspector1.png|thumbnail|200px|Opening Inspector in Workspace]]
[[Datei:openXMLInspector1.png|thumbnail|200px|Opening Inspector in Workspace]]

Or select the string only (incl. the quotes) and execute the "''InspectIt''" menu function,


[[Datei:XMLInspector1.png|thumbnail|200px|XML Inspector showing the DOM]]
[[Datei:XMLInspector1.png|thumbnail|200px|XML Inspector showing the DOM]]

Version vom 7. März 2026, 20:17 Uhr

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, (try it in a workspace or a code editor, by selecting the expression and executing it with 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

Or select the string only (incl. the quotes) and execute the "InspectIt" menu function,

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