SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Zealot manic's Avatar
    Join Date
    Dec 2001
    Location
    uk
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    xml parse errors

    I'm retrieving an XML document posted to my page using 3 simple lines

    Code:
     set xmldoc = Server.CreateObject("Microsoft.XMLDOM")
     xmldoc.async=false
     xmldoc.load(Request)
    I know there is data being sent but when i run

    Code:
     Response.write xmldoc.parseError.reason
    It's consistantly telling me No data is available for the requested resource. Does anyone know why this message would appear when the request "should" have some data in it.

    Also is there anyway I can view the raw results in "request"?
    Don't you just hate it when it works first time.

  2. #2
    SitePoint Addict Richard Conyard's Avatar
    Join Date
    Jun 2005
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    where are you getting request from?

    I am taking it that this is not the request object since that would be silly.

  3. #3
    SitePoint Zealot manic's Avatar
    Join Date
    Dec 2001
    Location
    uk
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    from what I can gather load(request) is the "reserved word" for pulling details out of a post header.

    the origin of the xml posted is unknown, the script simply waits for a remote page to call it -> runs through it's process -> outputs results... in this case a simple "ok got it"
    Don't you just hate it when it works first time.

  4. #4
    SitePoint Addict Richard Conyard's Avatar
    Join Date
    Jun 2005
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You've got to say what you want to pull out of the request object.

    You've your XML object which is expecting the location of your XML file, but your passing it the request object

    try something more like:
    Code:
    xmldoc.loadXML( request("myXMLField") )

  5. #5
    SitePoint Zealot manic's Avatar
    Join Date
    Dec 2001
    Location
    uk
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what you're saying makes sense but there's a big but.

    I have no idea what's in the XML document to start with, it's a document which can change and most likely will. I have no control what-so-ever what goes into it. My system needs to be fluid enough to accept changing structures and store them.

    At this stage all I'm bothered about is storing the exact XML doc as it comes.

    Also loadXML causes errors because it only accepts string formats, the information coming through is XML. So a nice little type mismatch error flashes up. To me that doesn't make much sense because I thought all XML could be read as text hence a string but it's in almost everything I've read up to now.
    Don't you just hate it when it works first time.

  6. #6
    SitePoint Addict Richard Conyard's Avatar
    Join Date
    Jun 2005
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    XML is only a string that follows pre-defined formatting rules. The code I gave you doesn't really care about what the XML is (provided it's valid), it just needs to know the POST or QueryString variable name it's sent to the webserver in.

  7. #7
    SitePoint Zealot manic's Avatar
    Join Date
    Dec 2001
    Location
    uk
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    see what your saying thanks for explaining

    my problem is I've no idea what that variable would be called. sources I've been through have all said use xmldoc.load(request) to pull anything out of the headers. from that I assume it pulls out whatevers there.

    in some test cases this did work, only time it seems to fail is when a doctype is defined and dtd supplied, no idea why that would stop anything from working.
    Don't you just hate it when it works first time.

  8. #8
    SitePoint Addict Richard Conyard's Avatar
    Join Date
    Jun 2005
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    For Each item in request.form
        response.write item
    Next
    
    For Each item in request.querystring
        response.write item
    Next
    That should do you

  9. #9
    SitePoint Zealot manic's Avatar
    Join Date
    Dec 2001
    Location
    uk
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if this is that simple i'm gonna be black and blue before the day is through!

    testing
    Don't you just hate it when it works first time.

  10. #10
    SitePoint Zealot manic's Avatar
    Join Date
    Dec 2001
    Location
    uk
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wasn't as simple as that... didn't work
    Don't you just hate it when it works first time.


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
  •