Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524

    Error inserting XML

    I am trying to add a tool to my app that allows the user to edit raw xml data and save that back to the source file. When the user completes their edits, I want them to be able to click a save button that will do the following:

    Code:
    -- get the text (XML) that was entered/edited
    str_NewXML = Input.GetText("inp_Edit");
    
    -- insert that into the previously loaded XML overwriting all contents
    XML.InsertXML("*", str_NewXML, XML.REPLACE);
    
    -- save the XML out to the source file
    XML.Save(str_XMLDB);
    
    -- display the source file in a web object
    Web.LoadURL("web_View", str_XMLDB);
    To keep things simple I am loading the XML from the file, pushing it to the input object and simply trying to save... no edits for now until I get this figured out.

    Problem is that the XML.Insert() action is failing with an error 37011: An error occurred while trying to insert XML.

    Any help is appreciated...
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  2. #2
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    I may not be right, but I think the problem is that you are defining the element path as "*" in the XML.InsertXML action.

    Yossi

  3. #3
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    I tried using the literal path but that didn't work either.

    Code:
    XML.InsertXML("root", str_NewXML, XML.REPLACE);
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  4. #4
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    You need to define the whole path, from "root" to element. Something like:
    "database/customer/address_info/country" (I copied the example in the help file).

    Yossi

  5. #5
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Are you looking to replace the entire XML code or just an element? If you are looking to replace the entire code then I would use XML.SetXML using the string from your Input object as the input for that action. If you are looking to replace just a portion then I would specify the whole path for that portion in the XML.InsertXML.

    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  6. #6
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    Yes I am trying to replace the entire <root> element... I'll try the XML.SetXML() instead... Now that I think about it, I guess I could have used TextFile.WriteFromString() as well.

    Thanks guys!
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  7. #7
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    If you want some of the builtin XML error checking I would use the XML commands. XML.SetXML will perform some error checking on the contents of the string. If those pass, then I would use the XML.Save to save it to a file.

    my .02

    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

Similar Threads

  1. Stuck in XML
    By playmenow in forum AutoPlay Media Studio 6.0
    Replies: 1
    Last Post: 03-17-2006, 01:03 PM
  2. XML format
    By TJ_Tigger in forum AutoPlay Media Studio 5.0
    Replies: 6
    Last Post: 10-04-2005, 12:47 PM
  3. Need help. How to add element to XML???
    By dmla in forum AutoPlay Media Studio 5.0
    Replies: 5
    Last Post: 11-10-2004, 02:05 AM
  4. XML plugin Project example - XML Weather from weather.com
    By kpsmith in forum AutoPlay Media Studio 5.0
    Replies: 8
    Last Post: 06-03-2004, 05:25 PM
  5. Spotlight: XML Actions Plugin
    By Desmond in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 03-15-2004, 03:56 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