Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 5th, 2007, 03:37 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

As I said before you can't use 'Set' for a simple property, only for objects.

--

Joe (Microsoft MVP - XML)
 
Old January 12th, 2007, 01:03 PM
Authorized User
 
Join Date: Sep 2004
Posts: 62
Thanks: 0
Thanked 1 Time in 1 Post
Default

Have a question for you I was hoping you could answer for me. You have already been a terrific help to me in getting this worked out (http://p2p.wrox.com/topic.asp?TOPIC_ID=54431)

But here is my problem. Everything I have set up when just the xml packet is sent and I parse it using the namespace, etc. However, and this may be a stupid question, I am unable to load the Request in the parser now because they are including other variables in a manner such as this:

User=user&Password=pass&Message=<?xml version="1.0" encoding="UTF-8"?>

So obviously when I attempt to load it and parse it does not work. How do I remove these vars, or ONLY load the "Message=" variable? Because right now I am simply doing this:

set xmlObj = Server.CreateObject("Msxml2.DomDocument.4.0")

xmlObj.async = False
xmlObj.validateOnParse = False
xmlObj.setProperty "SelectionLanguage","XPath"

ns = "www.detroittradingexchange.com/BuyerMessages"
xmlObj.setProperty "SelectionNamespaces","xmlns:ns='" & ns & "'"

bLoaded = xmlObj.load(Request)

If bLoaded Then ' It loaded and validated ok, continue..

But because of the other request variables it is not loading and I can not parse the document.

UGH...

Anything you could provide would be helpful - thank you.

 
Old January 13th, 2007, 11:42 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You should be able to use:
Code:
sXml = Request.QueryString("message")
bLoaded = xmlDoc.loadXML(sXml)
--

Joe (Microsoft MVP - XML)
 
Old January 15th, 2007, 01:07 PM
Authorized User
 
Join Date: Sep 2004
Posts: 62
Thanks: 0
Thanked 1 Time in 1 Post
Default

That is what I assumed, and have always done, but it is NOT working. I thought maybe that since I am using the Msxml2.DomDocument.4.0 this time (always had used the older 'Microsoft.XMLDOM' object before), that I needed to do something different... I have tried the request.form, request.querystring - nothing works. Do you think perhaps the xmlhttp.setRequestHeader "Content-Type", "text/xml" needs to be form/URLEncoded instead?

 
Old January 15th, 2007, 01:23 PM
Authorized User
 
Join Date: Sep 2004
Posts: 62
Thanks: 0
Thanked 1 Time in 1 Post
Default

OK check it - this is what is going on and I don't get it...

I take the variable on the page it posts to:

XML_ping = request("message")

then I even write it to make sure it is there:

response.write XML_ping

(now it shows the lists of values and everything looks good. The only thing I am concerned about is when I look at the page source to see the XML, there are no spaces where there should be - like this: <?xmlversion="1.0"encoding="UTF-8"?><PINGXB_REQUESTxmlns=, etc...)

How can I fix that?

But lets assume that is ok - when I do this:

bLoaded = xmlObj.load(XML_ping)

bLoaded is FALSE, as if it is not even loaded...

Any ideas?

 
Old January 15th, 2007, 01:40 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Maybe the XML string needs decoding first due to characters like < being escaped. Why they chose to send XML via the querystring I'll never know, it's asking for trouble.

--

Joe (Microsoft MVP - XML)
 
Old January 15th, 2007, 04:34 PM
Authorized User
 
Join Date: Sep 2004
Posts: 62
Thanks: 0
Thanked 1 Time in 1 Post
Default

Ok this is strange, but I don't really know the difference in these versions so...

This works fine when parsing the document that is sent like this:

xmlHttp.Send "User=USER&Password=PASS&Message=" & xmlDoc & "&Debug=false"

(WORKS):
XML_ping = Request("Message")
set xmlObj = Server.CreateObject("Microsoft.XMLDOM")
xmlObj.async = False
xmlObj.setProperty "SelectionLanguage","XPath"
ns = "www.detroittradingexchange.com/BuyerMessages"
xmlObj.setProperty "SelectionNamespaces","xmlns:ns='" & ns & "'"
bLoaded = xmlObj.loadxml(XML_ping)

(HOWEVER, THIS DOES NOT WORK WHEN TRYING TO USE THE NEWER OBJECT):

set xmlObj = Server.CreateObject("Msxml2.DomDocument.4.0")
SAME CODE AS ABOVE...

WHY? AAAAAAAARRRRRRRRRRRRRRGH!







Similar Threads
Thread Thread Starter Forum Replies Last Post
Object Required Error JeffGirard Access 5 October 2nd, 2009 08:09 AM
Object Required error voyeur Javascript 9 January 25th, 2008 11:50 AM
Compile Error: Object required DeannaF829 Beginning VB 6 1 April 24th, 2007 07:12 AM
Object required error ?? hman SQL Server ASP 11 June 21st, 2004 10:59 AM
error....Object required: '' sassenach Classic ASP Databases 2 August 4th, 2003 03:27 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.