Links regarding XML parsing in Navision

subhastersubhaster Member Posts: 64
Hi ,
Does anyone know , is/are there any links from where I can get an Idea of how to parse an XML file in Navision ?
Is there any e-book on such topic ?
Subhasish Chakraborty,
Systems Analyst,
MBS Dynamics.

Comments

  • KosheKoshe Member Posts: 37
    Hi,
    could you be more specific what are you trying to do? Could you give an example?

    And try to search the forum. There is lots of information about xml files.
  • subhastersubhaster Member Posts: 64
    actually , i would like to know how would i go for parsing an xml document (using XMLDOcuments,IXMLDomDocs).
    I am using a code that looks like this :-

    When I print by saying :-
    XmlNode;=XmlDom.Documenelement;
    message(XmlNode.text);
    the out put is perfect :-
    <MSG>ITEM0001</MSG>

    But when I use :-
    InMsg := InMessage;
    InS := InMsg.GetStream();
    XMLDom.load(InS);
    XmlNode := XMLDom.selectSingleNode('MSG');
    ParseRequest(XmlNode.text);

    I am getting an error like this :-
    You have not instantiated the automation variable. You can instantiate it by eighter creating it/ assigning it.
    Subhasish Chakraborty,
    Systems Analyst,
    MBS Dynamics.
  • DenSterDenSter Member Posts: 8,307
    In order to use an automation type variable, you have to instantiate it. For the XMLDom object, you first do this:
    CREATE(XMLDOM);
    
    and then you should be able to use its methods. Similarly, when you're done with the variable, you do this:
    CLEAR(XMLDOM);
    
    to destroy it from memory.
  • subhastersubhaster Member Posts: 64
    Thanks so much Den... I worked it out . Actually the MSMQ stream , that I was getting , was a text , but I was treating it as an XML File. Now I have changed the iussueing Web Service from where I was actually generating the XML, and now it is getting parsed properly.
    Subhasish Chakraborty,
    Systems Analyst,
    MBS Dynamics.
  • DenSterDenSter Member Posts: 8,307
    I think there's a LoadText method in XMLDOM that you could try also.
Sign In or Register to comment.