Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 13 of 13
  1. #1
    Join Date
    Dec 2005
    Posts
    17

    Read from XML document in AMS 6.0

    Hi,
    I am trying to figure out how to read from a xml document inside the \\autoplay\doc folder.

    I have created a button, and when the user presses the button I want it to read from the xml file. But I can not figure out how to do this.

    If any of you have some useful insigths on how to do this, please let me know as soon as possible.

    If I can read to a page by clicking on the button, then my problems are solved. Then I can start building my project.

    I have enclosed a test project, so that you will understand what I mean.
    Thanks for any input.
    Attached Files

  2. #2
    Join Date
    Jun 2005
    Location
    Germany
    Posts
    74
    hi abcnormal,

    it's all explained in the ams6 help file.

    just load your xml file into memory

    XML.Load(_TempFolder.."\\Temp.xml");

    get the value of the specified element

    local Result = XML.GetValue("report/result");
    local Error = XML.GetValue("report/error");

    byte

  3. #3
    Join Date
    Dec 2005
    Posts
    17
    But when I try that it returns Error loading XML file.

    I have the following code in the button:

    -- Load an XML file into memory.
    XML.Load(_TempFolder.."\\AutoPlay\\Docs\\001.xml") ;

    -- Check whether an error occurred
    error = Application.GetLastError();
    -- If no errors occurred...
    if (error == XML.OK) then

    local Result = XML.GetValue("product/item/id");
    local Nope = XML.GetValue("product/item/id");
    Dialog.Message("worked",Result);
    Dialog.Message("did not work",Nope);


    -- if no errors occurred, show id value
    error = Application.GetLastError();
    if (error == XML.OK) then

    else
    Dialog.Message("Error", _tblErrorMessages[error]);
    end


    else
    Dialog.Message("Error", _tblErrorMessages[error]);
    end


    And the following in the xml doc:
    <?xml version="1.0"?>
    <product>
    <item>
    <id>001</id>
    <name>Productname 1</name>
    <description>This is a testproduct</description>
    <price>12</price>
    </item>
    </product>

  4. #4
    Join Date
    Oct 2004
    Location
    East, South & West Asia
    Posts
    1,020

    Read from XML

    Hi,

    Talking about XML, OpenOffice 2.0 has now totally revamped their file formats to OpenText Document ( basically XML ).

    The files output are from Impress ( like MS PowerPoint ), Calc ( like MS Excel ) and Write ( like MS Doc ). I don't know whether OpenOffice Database can export to XML format or not, but I have imported DB CSV files into Calc and Write successfully.

    Check out >> www.openoffice.org , if you want to try.

    It's interesting to note that lots of companies are converting from MS to OpenOffice. This has huge potentials for AMS users to enrich themselves with more channels of opportunities.

    Has anyone delved with Porting AMS with OpenOffice documents?

  5. #5
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    I download OpenOffice 2.0 the other day and I was very impressed. I had tried it a few years ago but didn't like it. I now prefer using Write over Word. Also love the the presentaion program can output to Flash with a few clicks.

    Haven't tried accessing OpenOffice documents with AMS but I read this in the help file so it may very well be possible:
    The OpenDocument file format is an XML file format standardized by OASIS (Organization for the Advancement of Structured Information Standards).
    Dermot

    I am so out of here

  6. #6
    Join Date
    Oct 2004
    Location
    East, South & West Asia
    Posts
    1,020

    Great News There!

    Quote Originally Posted by Dermot
    I download OpenOffice 2.0 the other day and I was very impressed. I had tried it a few years ago but didn't like it. I now prefer using Write over Word. Also love the the presentaion program can output to Flash with a few clicks.

    Haven't tried accessing OpenOffice documents with AMS but I read this in the help file so it may very well be possible:
    Hi,

    Really keen to Port AMS with OpenOffice.

    It's something like importing a presentation file and then straight away doing little redesign over AMS. Also like importing pages of documents and set navigation using AMS, as a result becoming eBooks. Or even getting spreadsheet tables.

    Bottomline, it is about cutting production time and impressing clients with AMS goodies.

  7. #7
    Join Date
    Oct 2004
    Location
    East, South & West Asia
    Posts
    1,020

    Getting About

    Hi Dermot,

    I'm exploring thru this XML link examples:
    http://www.indigorose.com/forums/sea...earchid=227033 .

    Usually the examples are extremely helpful.

    Thanx for the tip.

  8. #8
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Really keen to Port AMS with OpenOffice.
    You should add that to the suggestions forum. Sounds like a good idea.

  9. #9
    Join Date
    Dec 2005
    Posts
    17
    azmanar, your link did not work.

    Can anyone tell me what I've done wrong on this one?
    Attached Files

  10. #10
    Join Date
    Oct 2004
    Location
    East, South & West Asia
    Posts
    1,020
    Quote Originally Posted by abcnormal
    azmanar, your link did not work.

    Can anyone tell me what I've done wrong on this one?
    Hi,

    Sorry about that. Here's a better link.

    http://www.indigorose.com/forums/sho...&highlight=XML

  11. #11
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Quote Originally Posted by abcnormal
    azmanar, your link did not work.

    Can anyone tell me what I've done wrong on this one?
    Change this:
    Code:
    -- Load an XML file into memory.
    XML.Load("\\AutoPlay\\Docs\\001.xml");
    To:
    Code:
    -- Load an XML file into memory.
    XML.Load("AutoPlay\\Docs\\001.xml");
    Dermot

    I am so out of here

  12. #12
    Join Date
    Dec 2005
    Posts
    17
    Thanks, that did it.
    I have to remember to start with "AutoPlay\\.." instead of "\\AutoPlay\\..".
    Thanks for letting me know, now it becomes much easier.

    Happy new year everybody.

  13. #13
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Happy new year abcnormal.

Similar Threads

  1. Online help files for the AMS 6.0 plug-ins
    By Corey in forum AutoPlay Media Studio 7.5 Examples
    Replies: 0
    Last Post: 11-28-2005, 08:12 PM
  2. AMS app that can read and write SQL data
    By sferguson in forum AutoPlay Media Studio 5.0
    Replies: 14
    Last Post: 11-03-2004, 08:20 AM
  3. INFO: Visual Basic 6.0 (SP5) Runtime Notes
    By Desmond in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 11-28-2003, 10:30 AM
  4. INFO: Visual Basic 6.0 (SP5) Runtime Support Module
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-30-2002, 03:00 PM
  5. HOWTO: Add DirectX 8.1 Support to your Setup Factory 6.0 Installation
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-30-2002, 01:55 PM

Posting Permissions

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