Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an xml with a .prg (having issues)

Filip Brnic

Programmer
Dec 25, 2023
67
RS
Hello everyone, I've been stuck on this for some time, I didn't really create xmls through fox, and neither did i work with them that much, i understand the syntax and the rules that i should open and close the tag, so now I'm confused why my code is giving me errors. I've used an example code from one other programmer, but he isn't coming anytime soon so I've tried to create it myself since there is a new law in Serbia that requires this xml.
Long story short i need to create the XML with this exact schema, values are gonna differ because they are gonna go directly from our program, this is the link to that xml: https://eotpremnica.efaktura.gov.rs/extfile/sr/5452/eOtpremnica UBL pr 001.xml
Now here is my code:


I think i made a mistake in defining those prefixes in my code, but i don't really understand why it doesn't work,
Because when i checked the code from my programmer and tried to run his xml, it worked just fine

I hope someone knows where I've made a mistake, if you want you can just copy my code into a prg and try in yourself, the values aren't from any tables for now so it should work, but again opening it on a browser is where it gets funky

* I had to attach it as a txt file because i cant attach prgs.
 

Attachments

  • LOCAL gnErrFile, red.txt
    34 KB · Views: 13
Last edited:
from red='<cec:UBLEtension>'
to red='<cec:UBLExtension>'


from red='<cbc:Name>Klasa opasnosti</cbc:Value>'
to red='<cbc:Name>Klasa opasnosti</cbc:Name>'

from red='<cbc:ID>urn:fdc:peppol.eu.logistics:bih:despatch_advice_only:1</cbc:profileID>'
to red='<cbc:ID>urn:fdc:peppol.eu.logistics:bih:despatch_advice_only:1</cbc:ID>'

from red='<cac:attachment>'
to red='<cac:Attachment>'

from red='</cac:partyIdentifiaction>'
to red='</cac:partyIdentification>'

from red='<cbc:StreetName>KNEZA MILOSA</cbc:Name>'
to red='<cbc:StreetName>KNEZA MILOSA</cbc:StreetName>'

from red='</cacPostalAddress>'
to red='</cac:postalAddress>'

and more equals bugs
 
Code contains many bugs...

  • XML is Case Sensitive
  • Missing start/end elements
  • Missing prefixes
 

Attachments

  • filip3.txt
    11.4 KB · Views: 4

Part and Inventory Search

Sponsor

Back
Top