XML Save Error


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: XML Save Error

  1. #1
    Larry Guest

    XML Save Error


    Perhaps a simple question, but one I have been unable to find an answer to.

    Have an ASP page with controls bound to an XML doc. Rather than posting
    the page we want to save the XML back to an ASP page something like:

    var PostObject = new ActiveXObject("Microsoft.XMLHTTP");
    PostObject.Open("POST", "Config.asp?Action=Save", false);
    PostObject.send(ConfigData.XMLDocument);

    The data will then be saved back into the database, assuming no errors are
    encountered. The question is: if an error IS encountered how would the error
    information be sent back to client? Is there something that can be inspected
    following the send to ensure that the data was processed successfully?

    TIA, Larry

  2. #2
    Russell Jones Guest

    Re: XML Save Error

    The config.asp page can return a response with the save status. You can
    retrieve the response from the XMLHTTP object's ResponseText (or ResponseXML
    if you return XML-formatted data) property.

    Russell Jones
    Sr. Web Development Editor,
    DevX.com

    "Larry" <tz@misc.com> wrote in message news:3b1e4dbb$1@news.devx.com...
    >
    > Perhaps a simple question, but one I have been unable to find an answer

    to.
    >
    > Have an ASP page with controls bound to an XML doc. Rather than posting
    > the page we want to save the XML back to an ASP page something like:
    >
    > var PostObject = new ActiveXObject("Microsoft.XMLHTTP");
    > PostObject.Open("POST", "Config.asp?Action=Save", false);
    > PostObject.send(ConfigData.XMLDocument);
    >
    > The data will then be saved back into the database, assuming no errors are
    > encountered. The question is: if an error IS encountered how would the

    error
    > information be sent back to client? Is there something that can be

    inspected
    > following the send to ensure that the data was processed successfully?
    >
    > TIA, Larry




  3. #3
    Larry Guest

    Re: XML Save Error


    Thanks, guess I hadn't considered that there was a round trip, but it makes
    sense...

    Another question if I may,
    I've got an XML doc in a page bound to a table. They can add rows easily
    via the recordset (XMLData.recordset.addnew) and I can post it and on the
    server get an XML doc (Microsoft.XMLDOM), but I don't see a recordset or
    similar structure on that end, how do people normally parse out the XML that
    has come in? Do they really parse out child nodes a field at a time, particularily
    when there are an unknown number of records? Seems like there must be a
    recordset type object available on the server end just like on the client
    end...

    TIA, Larry

    "Russell Jones" <arj1@northstate.net> wrote:
    >The config.asp page can return a response with the save status. You can
    >retrieve the response from the XMLHTTP object's ResponseText (or ResponseXML
    >if you return XML-formatted data) property.
    >
    >Russell Jones
    >Sr. Web Development Editor,
    >DevX.com
    >
    >"Larry" <tz@misc.com> wrote in message news:3b1e4dbb$1@news.devx.com...
    >>
    >> Perhaps a simple question, but one I have been unable to find an answer

    >to.
    >>
    >> Have an ASP page with controls bound to an XML doc. Rather than posting
    >> the page we want to save the XML back to an ASP page something like:
    >>
    >> var PostObject = new ActiveXObject("Microsoft.XMLHTTP");
    >> PostObject.Open("POST", "Config.asp?Action=Save", false);
    >> PostObject.send(ConfigData.XMLDocument);
    >>
    >> The data will then be saved back into the database, assuming no errors

    are
    >> encountered. The question is: if an error IS encountered how would the

    >error
    >> information be sent back to client? Is there something that can be

    >inspected
    >> following the send to ensure that the data was processed successfully?
    >>
    >> TIA, Larry

    >
    >



  4. #4
    Russell Jones Guest

    Re: XML Save Error

    On the server, load the posted recordset data into a Recordset object, not a
    DOMDocument. Basically, you're just persisting the recordset back and forth
    from the server to the client in XML format. The recordset XML contains
    information about added rows and maintains the original information for
    changed rows; therefore, you can use it to determine exactly which rows to
    update, and to check if the data has changed between the time you retrieved
    the record and the time that you're trying to update it. Use the updateBatch
    method and check errors carefully.

    "Larry" <tz@misc.com> wrote in message news:3b1fda47$1@news.devx.com...
    >
    > Thanks, guess I hadn't considered that there was a round trip, but it

    makes
    > sense...
    >
    > Another question if I may,
    > I've got an XML doc in a page bound to a table. They can add rows easily
    > via the recordset (XMLData.recordset.addnew) and I can post it and on the
    > server get an XML doc (Microsoft.XMLDOM), but I don't see a recordset or
    > similar structure on that end, how do people normally parse out the XML

    that
    > has come in? Do they really parse out child nodes a field at a time,

    particularily
    > when there are an unknown number of records? Seems like there must be a
    > recordset type object available on the server end just like on the client
    > end...
    >
    > TIA, Larry
    >
    > "Russell Jones" <arj1@northstate.net> wrote:
    > >The config.asp page can return a response with the save status. You can
    > >retrieve the response from the XMLHTTP object's ResponseText (or

    ResponseXML
    > >if you return XML-formatted data) property.
    > >
    > >Russell Jones
    > >Sr. Web Development Editor,
    > >DevX.com
    > >
    > >"Larry" <tz@misc.com> wrote in message news:3b1e4dbb$1@news.devx.com...
    > >>
    > >> Perhaps a simple question, but one I have been unable to find an answer

    > >to.
    > >>
    > >> Have an ASP page with controls bound to an XML doc. Rather than

    posting
    > >> the page we want to save the XML back to an ASP page something like:
    > >>
    > >> var PostObject = new ActiveXObject("Microsoft.XMLHTTP");
    > >> PostObject.Open("POST", "Config.asp?Action=Save", false);
    > >> PostObject.send(ConfigData.XMLDocument);
    > >>
    > >> The data will then be saved back into the database, assuming no errors

    > are
    > >> encountered. The question is: if an error IS encountered how would the

    > >error
    > >> information be sent back to client? Is there something that can be

    > >inspected
    > >> following the send to ensure that the data was processed successfully?
    > >>
    > >> TIA, Larry

    > >
    > >

    >




  5. #5
    Sean Guest

    Re: XML Save Error


    Russell,
    I think Larry is talking about the recordset object that comes with xml databinding
    on the client side and not a recordset persisted as xml.

    Sean
    "Russell Jones" <arj1@northstate.net> wrote:
    >On the server, load the posted recordset data into a Recordset object, not

    a
    >DOMDocument. Basically, you're just persisting the recordset back and forth
    >from the server to the client in XML format. The recordset XML contains
    >information about added rows and maintains the original information for
    >changed rows; therefore, you can use it to determine exactly which rows

    to
    >update, and to check if the data has changed between the time you retrieved
    >the record and the time that you're trying to update it. Use the updateBatch
    >method and check errors carefully.
    >
    >"Larry" <tz@misc.com> wrote in message news:3b1fda47$1@news.devx.com...
    >>
    >> Thanks, guess I hadn't considered that there was a round trip, but it

    >makes
    >> sense...
    >>
    >> Another question if I may,
    >> I've got an XML doc in a page bound to a table. They can add rows easily
    >> via the recordset (XMLData.recordset.addnew) and I can post it and on

    the
    >> server get an XML doc (Microsoft.XMLDOM), but I don't see a recordset

    or
    >> similar structure on that end, how do people normally parse out the XML

    >that
    >> has come in? Do they really parse out child nodes a field at a time,

    >particularily
    >> when there are an unknown number of records? Seems like there must be

    a
    >> recordset type object available on the server end just like on the client
    >> end...
    >>
    >> TIA, Larry
    >>
    >> "Russell Jones" <arj1@northstate.net> wrote:
    >> >The config.asp page can return a response with the save status. You can
    >> >retrieve the response from the XMLHTTP object's ResponseText (or

    >ResponseXML
    >> >if you return XML-formatted data) property.
    >> >
    >> >Russell Jones
    >> >Sr. Web Development Editor,
    >> >DevX.com
    >> >
    >> >"Larry" <tz@misc.com> wrote in message news:3b1e4dbb$1@news.devx.com...
    >> >>
    >> >> Perhaps a simple question, but one I have been unable to find an answer
    >> >to.
    >> >>
    >> >> Have an ASP page with controls bound to an XML doc. Rather than

    >posting
    >> >> the page we want to save the XML back to an ASP page something like:
    >> >>
    >> >> var PostObject = new ActiveXObject("Microsoft.XMLHTTP");
    >> >> PostObject.Open("POST", "Config.asp?Action=Save", false);
    >> >> PostObject.send(ConfigData.XMLDocument);
    >> >>
    >> >> The data will then be saved back into the database, assuming no errors

    >> are
    >> >> encountered. The question is: if an error IS encountered how would

    the
    >> >error
    >> >> information be sent back to client? Is there something that can be
    >> >inspected
    >> >> following the send to ensure that the data was processed successfully?
    >> >>
    >> >> TIA, Larry
    >> >
    >> >

    >>

    >
    >



  6. #6
    Larry Guest

    Re: XML Save Error


    Yep, perhaps I'm missing something regarding developing an application using
    XML as the data transport, it seems easy enough to pass the XML to the client
    and work with it there, however I can't seem to locate some good examples
    of using XML passed back to the server and utilizing it there (and I hate
    to reinvent the wheel here). I did find a parser on MS's site that would
    probably work OK for a single record with a known format, just seems like
    there should be an easier way (and perhaps there is).

    I'm passing down some XML and binding the controls to that XML. Using the
    XML recordset on the client I can easily add rows and they show up in the
    bound table. I can post the results back and get the XML stream in ASP something
    like:

    Set parser = CreateObject("Microsoft.XMLDOM")
    parser.async = false
    parser.load(Request)
    sXML=parser.xml

    Guess the question is, what is the easiest way to get this back into rows
    and columns. I guess that one could go through the whole DOMDocument object
    and navigate the various nodes but it seems like a whole lot of effort just
    to get a simple recordset to work with. Seems like someone must be doing
    this, but perhaps people only use XML for display purposes...

    Any pointers would be appreciated,
    Larry

    "Sean" <sean@ireland.com> wrote:
    >
    >Russell,
    >I think Larry is talking about the recordset object that comes with xml

    databinding
    >on the client side and not a recordset persisted as xml.
    >
    >Sean
    >"Russell Jones" <arj1@northstate.net> wrote:
    >>On the server, load the posted recordset data into a Recordset object,

    not
    >a
    >>DOMDocument. Basically, you're just persisting the recordset back and forth
    >>from the server to the client in XML format. The recordset XML contains
    >>information about added rows and maintains the original information for
    >>changed rows; therefore, you can use it to determine exactly which rows

    >to
    >>update, and to check if the data has changed between the time you retrieved
    >>the record and the time that you're trying to update it. Use the updateBatch
    >>method and check errors carefully.
    >>
    >>"Larry" <tz@misc.com> wrote in message news:3b1fda47$1@news.devx.com...
    >>>
    >>> Thanks, guess I hadn't considered that there was a round trip, but it

    >>makes
    >>> sense...
    >>>
    >>> Another question if I may,
    >>> I've got an XML doc in a page bound to a table. They can add rows easily
    >>> via the recordset (XMLData.recordset.addnew) and I can post it and on

    >the
    >>> server get an XML doc (Microsoft.XMLDOM), but I don't see a recordset

    >or
    >>> similar structure on that end, how do people normally parse out the XML

    >>that
    >>> has come in? Do they really parse out child nodes a field at a time,

    >>particularily
    >>> when there are an unknown number of records? Seems like there must be

    >a
    >>> recordset type object available on the server end just like on the client
    >>> end...
    >>>
    >>> TIA, Larry
    >>>
    >>> "Russell Jones" <arj1@northstate.net> wrote:
    >>> >The config.asp page can return a response with the save status. You

    can
    >>> >retrieve the response from the XMLHTTP object's ResponseText (or

    >>ResponseXML
    >>> >if you return XML-formatted data) property.
    >>> >
    >>> >Russell Jones
    >>> >Sr. Web Development Editor,
    >>> >DevX.com
    >>> >
    >>> >"Larry" <tz@misc.com> wrote in message news:3b1e4dbb$1@news.devx.com...
    >>> >>
    >>> >> Perhaps a simple question, but one I have been unable to find an answer
    >>> >to.
    >>> >>
    >>> >> Have an ASP page with controls bound to an XML doc. Rather than

    >>posting
    >>> >> the page we want to save the XML back to an ASP page something like:
    >>> >>
    >>> >> var PostObject = new ActiveXObject("Microsoft.XMLHTTP");
    >>> >> PostObject.Open("POST", "Config.asp?Action=Save", false);
    >>> >> PostObject.send(ConfigData.XMLDocument);
    >>> >>
    >>> >> The data will then be saved back into the database, assuming no errors
    >>> are
    >>> >> encountered. The question is: if an error IS encountered how would

    >the
    >>> >error
    >>> >> information be sent back to client? Is there something that can be
    >>> >inspected
    >>> >> following the send to ensure that the data was processed successfully?
    >>> >>
    >>> >> TIA, Larry


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center