<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>2 Jul 2019 10:50:06 Z</lastBuildDate><pubDate>5 Aug 2015 00:00:00 Z</pubDate><description>Hi I am working on an xml file. I need to generate a xml from an xsd The xsd is availeble so I imported that. OK&#13;
&#13;
Now I need so generate the xml. That works ok. But not when looping through something that needs to be added several times isnot saved in the xml with xmlsave()&#13;
&#13;
I need to generate an xml file called xml-audit file.&#13;
&#13;
My code:&#13;
&#13;
&#13;
sDatumcreated is string&#13;
sDatumcreated = DateToString(Today(),"YYYY-MM-DD")&#13;
sGeselecteerdBoekjaar is string&#13;
sTartDatBoekjaar is string&#13;
sEindDatBoekjaar is string&#13;
&#13;
&#13;
IF HReadSeekFirst(Boekjaar,BoekjaarID,COMBO_Boekjaar) THEN&#13;
sGeselecteerdBoekjaar = Boekjaar.Jaar&#13;
sTartDatBoekjaar = Boekjaar.Jaar + "-01-01"&#13;
sEindDatBoekjaar = Boekjaar.Jaar + "-12-31"&#13;
END&#13;
&#13;
//sStr is string = "xmldoc.auditfile."&#13;
xmldoc is xmlDocument , description = "XmlAuditfileFinancieel32"&#13;
xmldoc = XMLOpen("XmlAuditfileFinancieel32.xml",fromFile)&#13;
&#13;
&#13;
IF XMLValidDocument(xmldoc) = True THEN&#13;
&#13;
Filter is string = "XML files (*.xml)" + TAB + "*.xml" + CR + "All files (*.*)" + TAB + "*.*"&#13;
OutputFile is string = fSelect("", "", "Maak XML file...", Filter, "xml", fselCreate)&#13;
// Vullen header&#13;
xmldoc.auditfile.header.curCode = "EUR"&#13;
xmldoc.auditfile.header.softwareDesc = "Administratie"&#13;
xmldoc.auditfile.header.softwareVersion = ExeInfo(exeVersion)&#13;
xmldoc.auditfile.header.dateCreated = sDatumcreated&#13;
xmldoc.auditfile.header.fiscalYear = sGeselecteerdBoekjaar&#13;
xmldoc.auditfile.header.startDate = sTartDatBoekjaar&#13;
xmldoc.auditfile.header.endDate = sEindDatBoekjaar&#13;
&#13;
IF HReadFirst(Bedrijf,BedrijfID) THEN&#13;
//{sstr + "company.companyName" } = bedrijf.naam&#13;
//vullen company eerst nodes zonder child nodes&#13;
xmldoc.auditfile.company.companyName = Bedrijf.Naam&#13;
xmldoc.auditfile.company.companyIdent = gsadministratienaam&#13;
xmldoc.auditfile.company.taxRegistrationCountry ="NL"&#13;
xmldoc.auditfile.company.taxRegIdent = Bedrijf.BTW_nummer&#13;
// vullen company.streetAddress node&#13;
xmldoc.auditfile.company.streetAddress.streetname = Bedrijf.Adres&#13;
xmldoc.auditfile.company.streetAddress.city = Bedrijf.Woonplaats&#13;
xmldoc.auditfile.company.streetAddress.country = "NL"&#13;
xmldoc.auditfile.company.streetAddress.postalCode = Bedrijf.Postcode&#13;
xmldoc.auditfile.company.streetAddress.number = Bedrijf.huisnummer&#13;
xmldoc.auditfile.company.streetAddress.numberExtension = Bedrijf.huisnummertoevogsel&#13;
// vullen company.postalAddress node&#13;
xmldoc.auditfile.company.postalAddress.city = Bedrijf.Woonplaats&#13;
xmldoc.auditfile.company.postalAddress.postalCode = Bedrijf.Postcode&#13;
xmldoc.auditfile.company.postalAddress.streetname = Bedrijf.Adres&#13;
xmldoc.auditfile.company.postalAddress.number = Bedrijf.huisnummer&#13;
xmldoc.auditfile.company.postalAddress.numberExtension = Bedrijf.huisnummertoevogsel&#13;
xmldoc.auditfile.company.postalAddress.country = "NL"&#13;
END&#13;
// vullen cutomer supplier. Eert de klanten dan de leveranciers in de customer supplier type geef ik aan&#13;
// of het om een klant of Leverancier gaat. klant = C Leverancier = S Als unike id geef ik het id van het bestand&#13;
FOR ALL Klanten //where klanten.NietActief = 0&#13;
xmldoc.auditfile.company.customersSuppliers.customerSupplier.custSupID = Klanten.KlantenID&#13;
xmldoc.auditfile.company.customersSuppliers.customerSupplier.custSupName = Klanten.FirmaNaam&#13;
// Here is it where it goes wrong. The loop is run but only the last item in the loop is saved. If I place XMLSAVE()&#13;
in this section the same happens. The values are over written and only the last value is saved in the xml&#13;
END&#13;
&#13;
&#13;
XMLSave(xmldoc, OutputFile,XMLDocumentDefault)&#13;
IF ErrorOccurred = True THEN&#13;
Error("Unable to save the XML document", ErrorInfo())&#13;
ELSE&#13;
Info("OK", OutputFile)&#13;
END&#13;
ELSE&#13;
Error("The XML document is invalid", ErrorInfo())&#13;
END&#13;
&#13;
Anybody An Idea what Iam doing wrong. It seems to modify I need the loop items to be added. Do I need to add this to a buffer or something?&#13;
&#13;
Thanks&#13;
&#13;
Allard</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd/read.awp</link><title>generating a Xml from an XSD</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>etichyr</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-67123/read.awp</comments><pubDate>2 Jul 2019 10:50:06 Z</pubDate><description>ChrisC,&#13;
&#13;
I find your function very useful!&#13;
Thanks for publishing it!&#13;
&#13;
Marcin</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-67123/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-67123/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd/read.awp">generating a Xml from an XSD</source><title>Re: generating a Xml from an XSD</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53473/read.awp</comments><pubDate>7 Aug 2015 18:27:00 Z</pubDate><description>Allard&#13;
&#13;
This procedure will return a date time stamp in ISO 8601 format. Input is a local date and time (defaults to the curre…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53473/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53473/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd/read.awp">generating a Xml from an XSD</source><title>Re: generating a Xml from an XSD</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53466/read.awp</comments><pubDate>7 Aug 2015 14:38:00 Z</pubDate><description>Hi Allard,&#13;
&#13;
The date time format might be achieveable by something like this...&#13;
&#13;
DateToString(DateTimeLocalToUTC(DateSys + T…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53466/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53466/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd/read.awp">generating a Xml from an XSD</source><title>Re: generating a Xml from an XSD</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53448/read.awp</comments><pubDate>6 Aug 2015 13:24:00 Z</pubDate><description>Any one an Idea how to get this date time format?&#13;
&#13;
2001-12-17T09:30:47-05:00&#13;
&#13;
Thanks&#13;
Allard</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53448/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53448/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd/read.awp">generating a Xml from an XSD</source><title>Re: generating a Xml from an XSD</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53424/read.awp</comments><pubDate>5 Aug 2015 11:52:00 Z</pubDate><description>Hi Derek,&#13;
&#13;
Indeed I did that earlier on.I use windev 18 and there seems to be a bug on that. So I use the whole path everytime…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53424/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53424/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd/read.awp">generating a Xml from an XSD</source><title>Re: generating a Xml from an XSD</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53420/read.awp</comments><pubDate>5 Aug 2015 09:48:00 Z</pubDate><description>Allard&#13;
&#13;
You need to declare an 'xmlNode' variable.&#13;
&#13;
Look in the Help - there is a very good example.</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53420/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53420/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd/read.awp">generating a Xml from an XSD</source><title>Re: generating a Xml from an XSD</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53419/read.awp</comments><pubDate>5 Aug 2015 09:43:00 Z</pubDate><description>He Stefan,&#13;
&#13;
Thanks. I did the following and it works. Had do do this change to pass the validation of the xsd.&#13;
&#13;
xmldoc.audit…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53419/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53419/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd/read.awp">generating a Xml from an XSD</source><title>Re: generating a Xml from an XSD</title></item><item><author>eric</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53416/read.awp</comments><pubDate>5 Aug 2015 07:33:20 Z</pubDate><description>Did you try the following syntax in your FOR loop?&#13;
&#13;
xmldoc.auditfile.company.customersSuppliers.customerSupplier.custSupID[i] …</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53416/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53416/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd/read.awp">generating a Xml from an XSD</source><title>Re: generating a Xml from an XSD</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53415/read.awp</comments><pubDate>5 Aug 2015 07:15:00 Z</pubDate><description>Hi Allard,&#13;
&#13;
you can try to use an index for this part:&#13;
&#13;
i is int = 1&#13;
FOR ALL Klanten //where klanten.NietActief = 0&#13;
xmldoc…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53415/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd-53415/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/53412-generating-xml-from-xsd/read.awp">generating a Xml from an XSD</source><title>Re: generating a Xml from an XSD</title></item></channel></rss>
