Storing XML as a Blob and presenting/printing it.

KyleaKylea Member Posts: 39
Hi all,

OK I am sure I read somewhere in here about storing xml as a Blob and I am sure there was a beautiful example of the code but alas I can not find it again.

I am using V3.70 SQL and intend on storing a received xml response as xml in a blob field and then I am thinking of using the DocDom to somehow display the xml on screen so the user can either print or just view the formatted xml information.

Has anyone done this successfully?

Kylea.

Comments

  • nofirmnofirm Member Posts: 6
    Hi Kylea,

    i'm going thru the same process/problem.

    any suggestions?

    thanxs a lot
  • ta5ta5 Member Posts: 1,164
    Try this (may contain some typos)

    Import XML to Blob:
    //xmlDoc 'Microsoft XML, v3.0'.DOMDocument30	
    //xmlOutStream OutStream		
    
    myTable."XML File".CREATEOUTSTREAM(xmlOutStream);
    xmlDoc.save(xmlOutStream);
    myTable.MODIFY;
    



    Export XML from Blob and Show in Browser:
    //xmlDomDoc 'Microsoft XML, v3.0'.DOMDocument30	
    //xmlInStream InStream		
    
    TempFilename := 'c:\temp\test.xml';
    CALCFIELDS("XML File");
    IF myTable."XML File".HASVALUE THEN BEGIN
      // Stream XML out of Blob, show in Browser
      myTable."XML File".CREATEINSTREAM(xmlInStream);
      CREATE(xmlDomDoc);
      xmlDomDoc.load(xmlInStream);
      xmlDomDoc.save(TempFilename);
      HYPERLINK(TempFilename);
    END;
    
  • KyleaKylea Member Posts: 39
    OK thanks but let me explain a little further.

    We actually are using our own dll to place a request on a website and then receive a response (property).

    i.e. MyControl = Automation

    So the code goes something like this.

    MyControl.Request(request);

    Then we want the Response which is a property that is passed back into the dll --- but I am not sure how to get it back into Navision.

    So what I really want to do is something like this where
    ResponseRec = Table
    XMLResponseReport = Blob in ResponseRec
    XmlOutStream = OutStream

    I can do this to collect the Response using the dll.
    MyContorl.Response(Response);

    but I don't know how to get the Property 'Response' back into my table.
    I know this is incorrect code but I am just not sure how to get the property response into the Stream so I can save it in my blob field.

    ResponseRec.XMLResponseReport.CREATEOUTSTREAM(XmlOutStream);
    ResponseRec.Response.save(xmlOutStream);


    How can you return a property from a dll into a Navision blob?

    Kylea. ](*,)
  • nofirmnofirm Member Posts: 6
    ha5 Thanx a Lot!
Sign In or Register to comment.