xml port - tag name issue

jversusjjversusj Member Posts: 489
good day all,
I am building my first XMLPort. I believe i have the data mapped to the right holding table and fields in NAV and i have a codeunit that calls the xmlport. when i click my button that triggers the codeunit to run the XMLPort, i get an error.
Attribute <xml:lang> is required and does not match with Attribute <lang>

I look at my .xml file and confirm that the attribute is indeed xml:lang. I then look at my XMLPort and see my tag name xml:lang. It is set as an attribute, type text, datasource = cXMLxml:lang

i searched the forum and found 1 thread on this, where it suggested putting code behind the tag on import/export but that did not help.

can NAV read the semicolon in the tag name? when i try to surround the tag name with double quotes or <>, it will not compile because of tag name error. Any hints are greatly appreciated!
edit: still a problem, but confirmed that : is not a good character for XML ports, which is silly since so many people transmit XML using tags with : in them.
kind of fell into this...

Answers

  • jversusjjversusj Member Posts: 489
    this is the first bit of the xml file i have to work with.
    <cXML payloadID='#########.20081014092448.SEND_PO.SEQ######' timestamp='2008-10-14T09:26:09-00:00' xml:lang='en-US'>
          <Header>
            <From>
              ...so on...
    
    kind of fell into this...
  • kinekine Member Posts: 12,562
    I think that there are some limits to attribute name... I am afraid that that : in name is one of them, but I cannot find the document now or something where it is described. If it is true, best will be to use XMLDOM to process the XML...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • jversusjjversusj Member Posts: 489
    that's depressing because we bought the granule for XMLPort designer just for this project - and it won't work... sad. the XMLDOM method seems too hard for me to self-teach in the time frame i have left to get this working.

    maybe it will be possible to instead programmatically alter the xml doc before it gets into NAV? we could just make it lang and work through it. we aren't using that attribute anyhow.
    kind of fell into this...
  • Ian_BachusIan_Bachus Member Posts: 21
    Hi! I'm facing the exact same issue. So to get around this I just finished up code that would read the XML document as text file, remove the unwanted characters and attempt to create a new XML document (text file). As far as I can tell the code works, however, because of how the XML document is generated by the third party this method won't work because aren't any carriage returns in the file. I cannot read each line because the XML document is ONE HUGE line and there isn't a variable large enough to hold it. I don't see any resolution to this in this thread. Anyone know how to solve this?

    Thanks in advance!!
Sign In or Register to comment.