XML Plugin is a plugin for the 4th Dimension programming language that allows you to read and write XML documents in a more easy way. It goes far beyond the built-in XML commands of 4D.
There are several ways to access and interact with XML data. XML Plugin uses the Document Object Model (DOM), meaning the XML data is parsed into a tree object that can be navigated in an interactive way. It also allows you to modify an existing document or to create a new document from scratch and save it back to disk. The plugin takes care of all the formatting issues involved for creating well-formed XML files, so you don’t have to.
XML Plugin also allows you transform XML documents using stylesheets. XSL stands for eXtensible Style Language. XSL is a language that allows you to extract information from an XML document and re-order the output to a new format. This process is called Transforming which explains the letter T.
XSL allows you to separate content and layout from each other. The XML document holds the content in a structured format. The stylesheet specifies how to present this information. XSL is mostly used for cross-media publishing, where the same information has to be output to different kinds of media. The best known example is a newspaper that wants to publish its stories in a printed format, on the website and on small electronic devices like organizers or mobile phones. Because each output medium has its specific characteristics, it’s important to re-use the same data and format it to the particular needs of the output medium.
Here is a short list of the features available in XML Plugin:
- Fast RAM based XML parser.
- Create, open and save documents from and to to disk files or blob variables.
- Navigate through XML data using the Document Object Model.
- Work with huge XML documents using the XML Reader and XML Writer commands.
- Get and set values and attributes of nodes.
- Add, copy and delete nodes.
- Support for various encodings such as ISO8859-1, UTF-8 and UTF-16.
- A full validating parser with support for DTD, XML Schema and Relax NG schemas.
- Apply a SAX style callback method to the DOM tree.
- Support for namespaces.
- Support for XSL, XPath, XInclude and XPointer.
- Support for EXSLT, a set of extensions to XSLT.
- Support for GZip compressed XML data.
- Support for Canonical XML (C14N).
- Parameters can be passed to the transformation process.
- Debug and profiling information about the transformation process can be saved.
- Available for Mac OS X and Windows.
- Support for 4D 64-bit on Mac & Windows (32-bit mode is no longer supported).
- Support for pre-emptive multi-threading.
- Support for Intel and Apple Silicon based Macs.
- Fully compatible with 4D v18, v19 and v20.
Differences with the built-in XML commands
Starting with 4D 2003, 4D offers some built-in commands for dealing with XML. Where 4D 2003 only contains commands for reading an XML document, 4D 2004 offers commands for both reading and writing. XML Plugin offers a more complete set of commands with more advanced features. And according to some developers, it is easier to use.
Here is a list of the features you won’t find in the built-in commands:
- More powerful navigation commands that make it easier to find the data you are looking for.
- Apply a 4D method against a DOM tree, so you don’t have to write recursive code to traverse the DOM tree yourself.
- Full support for XPath (not just a subset) that allow you to query XML documents as if it were a database.
- The XML Reader and XML Writer commands can be used to work with multiple XML documents simultaneously.
- The XML Reader commands supports validation against a DTD.
- The XML Writer commands handle encoding of special characters automatically.
- Support for namespaces and XInclude.
- Support for various schema techniques (DTD, XML Schema, Relax NG and Schematron).
- Support for GZip compressed XML (both for reading and writing).
- Various parsing options that give you more control on white-space handling, allow you to disable DTD validation and substitution of entity references.
- Save fragments of an XML document (snippets).
- Validate a created or modified document against a schema definition.
- Support for a callback method that loads external resources such as DTDs from the database instead of the internet.
- Support for node types such as comments, processing instructions and DTDs.
- Ability to insert nodes before, after or as a child of another node.
- Copy nodes or complete node trees from one document to another.
- Get the line number of a node in the source document, which makes it easier to debug/inspect XML documents.
- Descriptive error messages telling you what is wrong with your code or the XML document.
Licensing & pricing
XML Plugin has a very simple licensing scheme:
- € 400 per platform (Mac or Windows)
- € 600 if both platforms are purchased at once (Mac and Windows)
Both licenses allow unlimited deployment.
Updates from version 4.x are available for € 300 per license (Mac or Windows) or € 400 for licenses covering both platforms (Mac and Windows).
Version 5.0 is now available!
Click on the following links to download a demo version of XML Plugin.
XML Plugin for Mac & Windows
Version 4.0 can be downloaded here
XML Plugin version 4.0.1 for Mac & Windows
Version 3.5 can be downloaded here
XML Plugin version 3.5 for Mac & Windows