Want to get rid of Google Ads, click here.
+ Reply to Thread
Results 1 to 2 of 2

Thread: export Datasets to wellformed xml

  1. #1
    Junior Member
    Join Date
    May 2003
    Posts
    8

    Default export Datasets to wellformed xml

    Hi,

    here's a little script i wrote to export datasets to a xml file.
    With a linked xsl you can present it as a nice looking html page or just use it as interface to external processes...

    function xml_export(table,select,path)
    {
    print( "Suche Datensätze");
    var Ref = new SCFile( table );
    var RC = Ref.doSelect( select);
    "
    if (RC !=RC_SUCCESS)
    {
    throw ("Error: "+RctoString(RC));
    }
    else
    {
    if (table="cm3r")
    {
    var XMLRec="<?xml version=\"1.0\" ?><?xml-stylesheet type=\"text/xsl\" href=\"changes.xsl\" ?><data>";
    }
    else
    {
    var XMLRec="<?xml version=\"1.0\" ?><data>";
    }
    while ( RC == RC_SUCCESS )
    {
    print( "Lese "+ Ref.number );
    var tmpXML=Ref.getXML();
    var tmpXMLStr=tmpXML.toXMLString();
    var XMLRec=XMLRec + tmpXMLStr;
    var RC=Ref.getNext();
    }
    var XMLRec=XMLRec + "</data>";
    print ("Schreibe in Datei...");
    writeFile( path+table+".xml", null, XMLRec );
    print ("Ende");
    }
    }
    Last edited by Frank S; 2006-10-17 at 20:11.

  2. #2
    Junior Member
    Join Date
    Oct 2007
    Posts
    3

    Default

    It's probably the same problem related to writeFile function. See the case 301 in this forum :
    http://www.sc-resources.net/search.php?searchid=19607

    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts