Problem with Escape-Characters in XML-File

JutJut Member Posts: 72
Good morning!

I fight strongly with one problem concerning XML-files used in Navision.

We receive a xml-File that looks like this:

<?xml version="1.0" encoding="utf-8"?>
<export xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Maintag>blabla<Maintag>

</export>

Now, I need to use this Input in Navision (<Maintag>blabla</Maintag>) to create e.g. some orders. We transform these escape-Characters at the moment manually, but unfortunately specials signs like the german Umlaute are also escaped and it would be a hard work to do it all manually.

Does anyone know a solution? Unfortunately we can't influence the XML-File we receive. We already tried the XMLDoc.loadXML Method und the load-Method but this all did not work or did not help.

Thanks a lot in advance :)

Jut

Comments

  • SteveOSteveO Member Posts: 164
    How are you importing the file?
    Is it through an XML Port, XMLDOM, or some other method.

    I haven't checked XML Ports but the XMLDOM automatically decodes the file for you.
    This isn't a signature, I type this at the bottom of every message
  • JutJut Member Posts: 72
    Normally, I am using the 'Microsoft XML, v6.0'.XMLHTTP60-Automation-Var but this time for testing I only create an XMLDoc and try to load the XML from a file.
  • SteveOSteveO Member Posts: 164
    Try this file:
    <?xml version="1.0" encoding="utf-8"?>
    <Main><ÖÄÜß></Main>
    

    With this code:
    XMLDOM Automation 'Microsoft XML, v6.0'.DOMDocument60
    XMLElement Automation 'Microsoft XML, v6.0'.IXMLDOMElement
    
    CREATE(XMLDOM);
    XMLDOM.load(whateveryousavethefileas);
    XMLElement := XMLDOM.selectSingleNode('Main');
    MESSAGE(XMLElement.text);
    

    The message for me correctly shows the decoded < and > and the other characters remain as is.
    This isn't a signature, I type this at the bottom of every message
Sign In or Register to comment.