Working With XML in the XML Viewer
Overview
XML files are typically very large, and can be difficult to navigate and manipulate with their complex structures. Reviewing and editing XML documents in a text editor like Notepad is time consuming and error prone - but with Andi, the user friendly XML Viewer does the hard work for you! With the XML Viewer, XML data stored in XML, BLOB or CLOB columns can be viewed and edited with ease.
Open a XML File in the XML Viewer
When a XML file is stored in a column, it will provide the option to Double Click and open in its associated viewer:
The XML Viewer will open with the selected XML file once it is selected:
Note: When the viewer opens XML text is not visible. XML documents can be very complex to visually search, so executions of XPath statements can be used to quickly retrieve portions of the document.
Search Using XPath Statement Search
The XPath Statement search box can be used to search an XML document and display one or more matches in the XML Results Viewer:
Manual XPath Statement Search
To manually create a XPath Statement, use the syntax: //*:ElementName and enter into the XPath Statement search box:
Dynamically Create a XPath Statement
To view all Element names in a list view select the Element Names button. The initial full list of Elements names can then be narrowed down to desired results using the dynamic List Filter:
A partial Element name can be entered with a trailing wildcard character (*) as another way to filter what Elements will appear for selection:
Once an Element has been selected, the XPath Search Results Viewer will appear with all occurrences of the Element.
View Results in the XML Results Viewer
If an XPath search executes successfully, the XML Results Viewer will be displayed. The navigation buttons (< or >) can be used to quickly move through the items if more than one item is available:
Update XML File
The XML Viewer includes an option to interactively update the XML file, while committing changes to the database.
As an example, the below TaxPeriodEndDate has been updated by simply editing directly in the XML Viewer:
Once the desired changes have been made, the Update Database button can be selected, and changes committed or rolled back, depending on if the rows affected match the desired results:
XSLT Transformation
XSLT (Extensible Stylesheet Language Transformations) is a language for transforming XML documents into other XML documents, or other formats such as HTML for web pages, plain text or XSL Formatting Objects, which may subsequently be converted to other formats, such as PDF, PostScript and PNG.
To access XSLT Transformation, select the XSLT Transformation option at the bottom of the XML Viewer:
An example of an XSLT Transformation is shown below. The node_count.xslt sample file has been opened:
The result is a node count that transforms the lengthy XML file into a compact count of occurrences for each Element:
File and Edit Menu
The File Menu includes the following options:
Open to folder: Open a Windows explorer to the visible documents directory
Save Formatted: Select a directory from dialog to save XML file
Save: Save to current file
The Edit Menu includes the following options:
Format: Select to auto-format the XML file for easier viewing
Copy Filename: Copy the filename of the current document to the Windows clipboard
Andi XML Tag
Andi Custom Tags are a unique part of Andi that can help turn time wasting tasks into efficient processes. With the Andi XML Tag it is simple to insert files into native XML columns.
To learn more about available Custom Tags related to XML, check out the article Technical Reference Document: Andi Custom Tags