More and more I am running into states equesting or requiring payroll tax documents in XML format. So I need to be able to create an XML document that is "Well Formed" with various levels of nesting.
In doing this I have come up with a few librry functions that will create the file and keep track of the nesting. There are still some niceties to add tot he program, like tracking titles in the nesting, but that is readily apparent when you look at the document that is produced.
The system consists of two functions FNXMLROOT and FNXML
FNXMLROOT opens the XML output file, adds the standatd header "?xml version....." and sets the ROOT Instance
FNXML is the used to add each additional line tot he file in the syntax
FNXML(TAG$,DATA$,end)
TAG$ is the name of the element
DATA$ is the value to be included
END is the number 1 if the element is to be ended on the same line or ) or non-existent if the line is a title element.
Entering a sunsequent FNXML with no parameters terminates any open element
Finally FNXMLROOT with no parameters terminates the ROOT element
Attached is a smple program.
I will attach the library separately to a new email.
FNGeorge
XML
Moderators: Susan Smith, admin, Gabriel
XML
- Attachments
-
- testxml.br
- program using the library
- (5.41 KiB) Downloaded 670 times
Library for the XML file creation.
Rename it to .DLL from .br
FNGeorge
Rename it to .DLL from .br
FNGeorge
- Attachments
-
- xmllib.br
- Library for XML file creation
- (8.44 KiB) Downloaded 694 times
The XMLLIB that I posted earlier had a capitalization problem with one of the parameters which casued it not to work with a SCHEMA.
schemalocation should have been schemaLocation.
The attched file corrects this problem.
The file expects to be renamed to XMLLIB.dll
FNGeorge
schemalocation should have been schemaLocation.
The attched file corrects this problem.
The file expects to be renamed to XMLLIB.dll
FNGeorge
- Attachments
-
- xmllib.br
- Corrected capitlization for schemaLocation
- (8.44 KiB) Downloaded 669 times