XML
Posted: Sat Feb 09, 2013 7:10 pm
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
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