The XML Viewer component can be used to browse the XML documents available in the XML Documents in the XNGR XML Browser application. The user can select elements by defining XPath expressions on the tool-bar. The selected elements are highlighted and expanded. The amount of information visible when browsing can be changed to avoid clutter when browsing.
The user can select elements by defining a XPath expression on the tool-bar and pressing the Select button. The selected elements are highlighted and expanded. Only elements can be selected, XPath expressions that return Strings or Attributes will not return any results.
A XPath search for elements without a namespace could look like this:
/root/parentelement/childelement
A XPath search for elements with a prefix looks like this:
/pfx:root/pfx:parentelement/pfx:childelement
To search XML with a default Namespaces, use the following expression:
/*[childelement()='root']/*[childelement()='parentelement']/*[childelement()='childelement']
When browsing through the elements, the XPath for the current selected element is displayed in the XPath field (this can be used to select similar elements) and the element's universal name is displayed on the status bar.
The amount of information visible when browsing can be changed. The browser can for instance only show the names of the elements without attributes, namespaces or element values or the browser can show all the elements with attributes but without namespaces and prefixes to avoid the clutter when browsing.
Note: Elements that have mixed content can not be expanded, the mixed content however is displayed with the same formatting, colors and font-styles as any of the 'normal' elements.