Tools XML Inspector and XPath Generator/en: Unterschied zwischen den Versionen
Cg (Diskussion | Beiträge) |
Cg (Diskussion | Beiträge) |
||
| Zeile 61: | Zeile 61: | ||
Or select the string only (incl. the quotes) and execute the "''InspectIt''" menu function, |
Or select the string only (incl. the quotes) and execute the "''InspectIt''" menu function, |
||
[[ |
[[File:XMLInspector1.png|thumbnail|200px|XML Inspector showing the DOM]] |
||
Back to [[Online_Documentation#Tools | Online Documentation]]. |
Back to [[Online_Documentation#Tools | Online Documentation]]. |
||
Version vom 7. März 2026, 20:20 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()

Or select the string only (incl. the quotes) and execute the "InspectIt" menu function,
Back to Online Documentation.
Back to Tools.