i.SAF-T Full Version XML Validation against XSD
References
Lithuania i-SAFT XSD Schema | |
Visual Studio Code download | |
XML Extension for VS Code Documentation | What's new in the Visual Studio Code XML Extension | Red Hat Developer |
Notepad++ download |
XML Validation using Visual Studio Code (for Windows, Mac, Linux)
Steps:
Open the Visual Studio Code application
Install the XML extension
Navigate to the Extensions tab
Enter “XML” in the search bar
Click the XML Extension by Red Hat
Click the [Install] button
Open the LT i.SAF-T XML file
Click “File” > click “Open File…”
On the pop-up window, navigate to the directory where the XML file is located
Select the XML file
Click [Open]
Bind XML to a Schema located in local directory
Navigate to the <AuditFile> element of the XML
Hover to the “…” icon
Click “Quick Fix…”
Click “Bind to existing grammar/schema”
Select “local” binding type
On the pop-up window, navigate to the directory where the XSD file is located
Select the XML file
Click [Select XSD file]
Select “Standard (xsi, DOCTYPE) binding type)
Remove previously bound Schema
Navigate to the <AuditFile> element of the XML
Remove the following attributes:
Save the XML document
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="https://www.vmi.lt/cms/saf-t"
XML Validation against XSD is now working in real-time. Errors, if there are any, will be underlined by the red crooked lines. Hover over the the lines to check the error details.
XML Validation using Notepad++ (for Windows)
Steps:
Open the Notepad++ application
Install XML Tools plugin
Navigate to Plugins > “Plugins Admin…”
On the Plugins Admin window > Available tab, enter “XML Tools” in the search bar
Check the box for “XML Tools” then click the [Install] button
Confirm installation by clicking [OK]
After installation, Notepad++ application is restarted
Open the LT i.SAF-T XML file
Click “File” > click “Open…”
On the pop-up window, navigate to the directory where the XML file is located
Select the XML file
Click [Open]
Validate XML against Schema on-demand
Navigate to Plugins > XML Tools > “Validate now”
On the Select File pop-up window, click the […] button
Navigate to the directory where the XSD file is located
Select the XSD file
Click [Open]
Schema and Namespace fields are populated. Click the [OK] button.
If error exists, its details are highlighted in yellow. Otherwise, “No error detected” message in a pop-up window is shown.