1 Reply Latest reply on Jun 13, 2007 2:03 PM by insuractive

    passing XML Node object  as form variable

      How does one pass an XML Node as a form variable? When I try it, I don't get the results I expect. In the receiving template, I get a message like form.var is an "XmlNodeList at 3ef0xxx", but this variable is neither a structure nor an array using IsStruct() or IsArray(). So what is it?

      My intent is to use an XML file as the source of data displayed on webpage 1. The user fills out a form on webpage1 to update the XML data. Upon clicking the submit key, the XML root node and the user's values are passed to webpage 2 to process and update/modify the XML document.

        • 1. Re: passing XML Node object  as form variable
          insuractive Level 3
          You cannot pass complex objects (i.e. a parsed XML document) via a form field. You have a couple of solutions:

          1) Store your parsed XML document in the user's session scope
          2) Pass the unparsed XML text via a hidden form field (you'll probably want to encode the data to prevent problems with < > and quotation marks)
          3) Only pass the id or location of the XML file, then retrieve it on the action page
          4) Serialize the parsed XML document back to XML text (see 2) or WDDX