Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > How to Extract URL from XML page using ASP code

Reply
Thread Tools

How to Extract URL from XML page using ASP code

 
 
Billy
Guest
Posts: n/a
 
      08-18-2007
Can anyone guide me to a resource for learning how to extract a URL
from an XML page using ASP 3.0 code?

This link below is an Amazon web services link that produces an XML
page. The resulting XML page has another URL embedded within it that I
need to extract and use to redirect the site to it's final URL
destination.

http://webservices.amazon.com/onca/x...m.3.Quantity=1

 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      08-18-2007
Billy wrote:
> Can anyone guide me to a resource for learning how to extract a URL
> from an XML page using ASP 3.0 code?
>
> This link below is an Amazon web services link that produces an XML
> page. The resulting XML page has another URL embedded within it that I
> need to extract and use to redirect the site to it's final URL
> destination.
>
> http://webservices.amazon.com/onca/x...m.3.Quantity=1


set urlnode = xmldoc.selectSingle Node("/CartCreateResponse")
url=urlnode.getAttribute("xmlns")

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
 
 
 
Billy
Guest
Posts: n/a
 
      08-19-2007
On Aug 18, 7:10 am, "Bob Barrows [MVP]" <(E-Mail Removed)>
wrote:
> Billy wrote:
> > Can anyone guide me to a resource for learning how to extract a URL
> > from an XML page using ASP 3.0 code?

>
> > This link below is an Amazon web services link that produces an XML
> > page. The resulting XML page has another URL embedded within it that I
> > need to extract and use to redirect the site to it's final URL
> > destination.

>
> >http://webservices.amazon.com/onca/x...erceService&AW...

>
> set urlnode = xmldoc.selectSingle Node("/CartCreateResponse")
> url=urlnode.getAttribute("xmlns")
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"


I dont understand what this is. Where does my URL go? Where do you
specify the data you ant to extract in the URL?

 
Reply With Quote
 
Billy
Guest
Posts: n/a
 
      08-19-2007
On Aug 18, 7:10 am, "Bob Barrows [MVP]" <(E-Mail Removed)>
wrote:
> Billy wrote:
> > Can anyone guide me to a resource for learning how to extract a URL
> > from an XML page using ASP 3.0 code?

>
> > This link below is an Amazon web services link that produces an XML
> > page. The resulting XML page has another URL embedded within it that I
> > need to extract and use to redirect the site to it's final URL
> > destination.

>
> >http://webservices.amazon.com/onca/x...erceService&AW...

>
> set urlnode = xmldoc.selectSingle Node("/CartCreateResponse")
> url=urlnode.getAttribute("xmlns")
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"


OK, I read up on the XML DOM and I coded this. However, I get the
message

Microsoft VBScript runtime error '800a01a8'
Object required
/amazon_cart.asp, line 17


Line #17 is the url = urlnode.getAttribute("xmlns") coded line as
shown below......


<html>

<head>
<title>Amazon Cart</title>
</head>

<body>

<%
Dim objXML
Set objXML = Server.CreateObject("Msxml2.DOMDocument.3.0")
objXML.async = False
objXML.Load("http://webservices.amazon.com/onca/xml?
Service=AWSECommerceService&AWSAccessKeyId=ACCESSI D&Operation=CartCreate&Item.
1.ASIN=B000E73MO0" &_
"&Item.1.Quantity=1&Item.2.ASIN=B00005T3E4&Ite m.
2.Quantity=1&Item.3.ASIN=B000BOLJ64&Item.3.Quantit y=1")

Set urlnode = objXML.selectSingleNode("/CartCreateResponse")
url = urlnode.getAttribute("xmlns")
Response.Write url

Set objXML = Nothing
%>

</body>

Is this code compatible with the 3.0 ver of DOM? Could it be something
needed on the hosted server side? I use DiscountASP.net which just
about covers all technologies.....

 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      08-19-2007
"Billy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> On Aug 18, 7:10 am, "Bob Barrows [MVP]" <(E-Mail Removed)>
> wrote:
> > Billy wrote:
> > > Can anyone guide me to a resource for learning how to extract a URL
> > > from an XML page using ASP 3.0 code?

> >
> > > This link below is an Amazon web services link that produces an XML
> > > page. The resulting XML page has another URL embedded within it that I
> > > need to extract and use to redirect the site to it's final URL
> > > destination.

> >
> >

>http://webservices.amazon.com/onca/x...erceService&AW...
> >
> > set urlnode = xmldoc.selectSingle Node("/CartCreateResponse")
> > url=urlnode.getAttribute("xmlns")
> >
> > --
> > Microsoft MVP - ASP/ASP.NET
> > Please reply to the newsgroup. This email account is my spam trap so I
> > don't check it very often. If you must reply off-line, then remove the
> > "NO SPAM"

>
> OK, I read up on the XML DOM and I coded this. However, I get the
> message
>
> Microsoft VBScript runtime error '800a01a8'
> Object required
> /amazon_cart.asp, line 17
>
>
> Line #17 is the url = urlnode.getAttribute("xmlns") coded line as
> shown below......
>
>
> <html>
>
> <head>
> <title>Amazon Cart</title>
> </head>
>
> <body>
>
> <%
> Dim objXML
> Set objXML = Server.CreateObject("Msxml2.DOMDocument.3.0")
> objXML.async = False
> objXML.Load("http://webservices.amazon.com/onca/xml?
>

Service=AWSECommerceService&AWSAccessKeyId=ACCESSI D&Operation=CartCreate&Ite
m.
> 1.ASIN=B000E73MO0" &_
> "&Item.1.Quantity=1&Item.2.ASIN=B00005T3E4&Ite m.
> 2.Quantity=1&Item.3.ASIN=B000BOLJ64&Item.3.Quantit y=1")
>
> Set urlnode = objXML.selectSingleNode("/CartCreateResponse")
> url = urlnode.getAttribute("xmlns")
> Response.Write url
>
> Set objXML = Nothing
> %>
>
> </body>
>
> Is this code compatible with the 3.0 ver of DOM? Could it be something
> needed on the hosted server side? I use DiscountASP.net which just
> about covers all technologies.....
>


The error you are getting is due to the urlnode being Nothing. This is in
turn is due to the XML not containing a CartCreateResponse root node.
Which is probably because the Load failed. Load returns true if it has
successfully loaded the content.

After calling objXML.load you should check objXML.parseError.errorCode is 0.
If not then there was a problem loading or parsing the document.
objXML.parseError.reason will specify what went wrong.

Note before calling load you should use this line of code:-

objXML.setProperty "ServerHTTPRequest", True

Try using:-

Response.Write objXML.parseError.reason

just to see if things are OK.

Then try:-

Response.Content-Type = "text/xml"
Response.CharSet = "UTF-8"
objXML.save Response

to see the actual XML received.

Once you're happy you getting the expected XML you can change your code to
start actually using it.


--
Anthony Jones - MVP ASP/ASP.NET


 
Reply With Quote
 
Billy
Guest
Posts: n/a
 
      08-19-2007
On Aug 19, 4:59 am, "Anthony Jones" <(E-Mail Removed)> wrote:
> "Billy" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed) oups.com...
>
>
>
> > On Aug 18, 7:10 am, "Bob Barrows [MVP]" <(E-Mail Removed)>
> > wrote:
> > > Billy wrote:
> > > > Can anyone guide me to a resource for learning how to extract a URL
> > > > from an XML page using ASP 3.0 code?

>
> > > > This link below is an Amazon web services link that produces an XML
> > > > page. The resulting XML page has another URL embedded within it that I
> > > > need to extract and use to redirect the site to it's final URL
> > > > destination.

>
> >http://webservices.amazon.com/onca/x...erceService&AW....

>
> > > set urlnode = xmldoc.selectSingle Node("/CartCreateResponse")
> > > url=urlnode.getAttribute("xmlns")

>
> > > --
> > > Microsoft MVP - ASP/ASP.NET
> > > Please reply to the newsgroup. This email account is my spam trap so I
> > > don't check it very often. If you must reply off-line, then remove the
> > > "NO SPAM"

>
> > OK, I read up on the XML DOM and I coded this. However, I get the
> > message

>
> > Microsoft VBScript runtime error '800a01a8'
> > Object required
> > /amazon_cart.asp, line 17

>
> > Line #17 is the url = urlnode.getAttribute("xmlns") coded line as
> > shown below......

>
> > <html>

>
> > <head>
> > <title>Amazon Cart</title>
> > </head>

>
> > <body>

>
> > <%
> > Dim objXML
> > Set objXML = Server.CreateObject("Msxml2.DOMDocument.3.0")
> > objXML.async = False
> > objXML.Load("http://webservices.amazon.com/onca/xml?

>
> Service=AWSECommerceService&AWSAccessKeyId=ACCESSI D&Operation=CartCreate&It*e
> m.
>
>
>
>
>
> > 1.ASIN=B000E73MO0" &_
> > "&Item.1.Quantity=1&Item.2.ASIN=B00005T3E4&Ite m.
> > 2.Quantity=1&Item.3.ASIN=B000BOLJ64&Item.3.Quantit y=1")

>
> > Set urlnode = objXML.selectSingleNode("/CartCreateResponse")
> > url = urlnode.getAttribute("xmlns")
> > Response.Write url

>
> > Set objXML = Nothing
> > %>

>
> > </body>

>
> > Is this code compatible with the 3.0 ver of DOM? Could it be something
> > needed on the hosted server side? I use DiscountASP.net which just
> > about covers all technologies.....

>
> The error you are getting is due to the urlnode being Nothing. This is in
> turn is due to the XML not containing a CartCreateResponse root node.
> Which is probably because the Load failed. Load returns true if it has
> successfully loaded the content.
>
> After calling objXML.load you should check objXML.parseError.errorCode is0.
> If not then there was a problem loading or parsing the document.
> objXML.parseError.reason will specify what went wrong.
>
> Note before calling load you should use this line of code:-
>
> objXML.setProperty "ServerHTTPRequest", True
>
> Try using:-
>
> Response.Write objXML.parseError.reason
>
> just to see if things are OK.
>
> Then try:-
>
> Response.Content-Type = "text/xml"
> Response.CharSet = "UTF-8"
> objXML.save Response
>
> to see the actual XML received.
>
> Once you're happy you getting the expected XML you can change your code to
> start actually using it.
>
> --
> Anthony Jones - MVP ASP/ASP.NET- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


I used the objXML.setProperty "ServerHTTPRequest", True right before
the XML load and this worked - I recvd back the contents of the xmlns
tag in my browser. Thank you!

However, I really need to grab the PurchaseURL in tis XML (shown
below) and submit it automatically to the browser. I suspect that I
will use a Response.Redirect to submit the PurchaseURL, but I need to
understand how to get to it first.

I looked on the web for SlectSingleNode syntax and I've had a real
hard time getting good information on it for beginners. I've also read
through XML DOM in W3 Schools, but have yet to find out how the
SelectSingleNode parameters works. I suspect that I'm using the
correct function by using SelectSingleNode (If I'm wrong, please
advise).

I really just need to understand how to navigate through the nodes to
grab what I want. Any examples would be appreciated.


Here is the XML that I load:

<?xml version="1.0" encoding="UTF-8" ?>
- <CartCreateResponse xmlns="http://webservices.amazon.com/
AWSECommerceService/2005-10-05">
+ <OperationRequest>
- <HTTPHeaders>
<Header Name="UserAgent" Value="Mozilla/4.0 (compatible; MSIE 7.0;
Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.0.3705; .NET CLR
1.1.4322)" />
</HTTPHeaders>
<RequestId>1Y86JP8EYYVME4ZVD8ZG</RequestId>
- <Arguments>
<Argument Name="Item.1.ASIN" Value="B000E73MO0" />
<Argument Name="Service" Value="AWSECommerceService" />
<Argument Name="Item.2.ASIN" Value="B00005T3E4" />
<Argument Name="Item.1.Quantity" Value="1" />
<Argument Name="Item.2.Quantity" Value="1" />
<Argument Name="Operation" Value="CartCreate" />
<Argument Name="Item.3.Quantity" Value="1" />
<Argument Name="Item.3.ASIN" Value="B000BOLJ64" />
<Argument Name="AWSAccessKeyId" Value="ACCESSKeyId" />
</Arguments>
<RequestProcessingTime>0.232803106307983</RequestProcessingTime>
</OperationRequest>
- <Cart>
- <Request>
<IsValid>True</IsValid>
- <CartCreateRequest>
- <Items>
- <Item>
<ASIN>B000E73MO0</ASIN>
<Quantity>1</Quantity>
</Item>
- <Item>
<ASIN>B00005T3E4</ASIN>
<Quantity>1</Quantity>
</Item>
- <Item>
<ASIN>B000BOLJ64</ASIN>
<Quantity>1</Quantity>
</Item>
</Items>
</CartCreateRequest>
</Request>
<CartId>102-8451736</CartId>
<HMAC>8Ii25TILTMsE7n2zl=</HMAC>
<URLEncodedHMAC>8Ii25TILTMsE7n2zln%2BoVMt5Hn0%3D </URLEncodedHMAC>
<PurchaseURL>https://www.amazon.com/gp/cart/aws-merge.html?cart-
id=102-8451736%26associate-id=Mt5Hn0=
%26SubscriptionId=G2%26MergeCart=False</PurchaseURL>
- <SubTotal>
<Amount>9191</Amount>
<CurrencyCode>USD</CurrencyCode>
<FormattedPrice>$91.91</FormattedPrice>
</SubTotal>
- <CartItems>
- <SubTotal>
<Amount>9191</Amount>
<CurrencyCode>USD</CurrencyCode>
<FormattedPrice>$91.91</FormattedPrice>
</SubTotal>
- <CartItem>
<CartItemId>U2XH7SPFEHRQLD</CartItemId>
<ASIN>B000E73MO0</ASIN>
<MerchantId>ATVPDKIKX0DER</MerchantId>
<SellerId>A2R2RITDJNW1Q6</SellerId>
<SellerNickname>Amazon.com</SellerNickname>
<Quantity>1</Quantity>
<Title>Mrs. Meyer's Clean Day Counter Top Spray, Lavender, Case of 6
- 16 Ounce Bottles (96 Ounces)</Title>
<ProductGroup>Drugstore</ProductGroup>
- <Price>
<Amount>2754</Amount>
<CurrencyCode>USD</CurrencyCode>
<FormattedPrice>$27.54</FormattedPrice>
</Price>
- <ItemTotal>
<Amount>2754</Amount>
<CurrencyCode>USD</CurrencyCode>
<FormattedPrice>$27.54</FormattedPrice>
</ItemTotal>
</CartItem>
- <CartItem>
<CartItemId>U1QXVOR3X7NSH0</CartItemId>
<ASIN>B00005T3E4</ASIN>
<MerchantId>ATVPDKIKX0DER</MerchantId>
<SellerId>A2R2RITDJNW1Q6</SellerId>
<SellerNickname>Amazon.com</SellerNickname>
<Quantity>1</Quantity>
<Title>Duracell Ultra AAA Batteries - 8-Pack</Title>
<ProductGroup>Drugstore</ProductGroup>
- <Price>
<Amount>599</Amount>
<CurrencyCode>USD</CurrencyCode>
<FormattedPrice>$5.99</FormattedPrice>
</Price>
- <ItemTotal>
<Amount>599</Amount>
<CurrencyCode>USD</CurrencyCode>
<FormattedPrice>$5.99</FormattedPrice>
</ItemTotal>
</CartItem>
- <CartItem>
<CartItemId>U2BTS0V2OTNF7J</CartItemId>
<ASIN>B000BOLJ64</ASIN>
<MerchantId>ATVPDKIKX0DER</MerchantId>
<SellerId>A2R2RITDJNW1Q6</SellerId>
<SellerNickname>Amazon.com</SellerNickname>
<Quantity>1</Quantity>
<Title>Tide Free Powder Detergent, Case Pack, Four - 60 Load Boxes
(240 Loads)</Title>
<ProductGroup>Drugstore</ProductGroup>
- <Price>
<Amount>5838</Amount>
<CurrencyCode>USD</CurrencyCode>
<FormattedPrice>$58.38</FormattedPrice>
</Price>
- <ItemTotal>
<Amount>5838</Amount>
<CurrencyCode>USD</CurrencyCode>
<FormattedPrice>$58.38</FormattedPrice>
</ItemTotal>
</CartItem>
</CartItems>
</Cart>
</CartCreateResponse>



 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      08-19-2007

"Billy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
On Aug 19, 4:59 am, "Anthony Jones" <(E-Mail Removed)> wrote:
> "Billy" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed) oups.com...
>
>
>>>>>>>>>>>>>

I used the objXML.setProperty "ServerHTTPRequest", True right before
the XML load and this worked - I recvd back the contents of the xmlns
tag in my browser. Thank you!

However, I really need to grab the PurchaseURL in tis XML (shown
below) and submit it automatically to the browser. I suspect that I
will use a Response.Redirect to submit the PurchaseURL, but I need to
understand how to get to it first.

I looked on the web for SlectSingleNode syntax and I've had a real
hard time getting good information on it for beginners. I've also read
through XML DOM in W3 Schools, but have yet to find out how the
SelectSingleNode parameters works. I suspect that I'm using the
correct function by using SelectSingleNode (If I'm wrong, please
advise).

I really just need to understand how to navigate through the nodes to
grab what I want. Any examples would be appreciated.


Here is the XML that I load:

<?xml version="1.0" encoding="UTF-8" ?>
- <CartCreateResponse xmlns="http://webservices.amazon.com/
AWSECommerceService/2005-10-05">
+ <OperationRequest>
- <HTTPHeaders>
<Header Name="UserAgent" Value="Mozilla/4.0 (compatible; MSIE 7.0;
Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.0.3705; .NET CLR
1.1.4322)" />
</HTTPHeaders>
<RequestId>1Y86JP8EYYVME4ZVD8ZG</RequestId>
- <Arguments>
<Argument Name="Item.1.ASIN" Value="B000E73MO0" />
<Argument Name="Service" Value="AWSECommerceService" />
<Argument Name="Item.2.ASIN" Value="B00005T3E4" />
<Argument Name="Item.1.Quantity" Value="1" />
<Argument Name="Item.2.Quantity" Value="1" />
<Argument Name="Operation" Value="CartCreate" />
<Argument Name="Item.3.Quantity" Value="1" />
<Argument Name="Item.3.ASIN" Value="B000BOLJ64" />
<Argument Name="AWSAccessKeyId" Value="ACCESSKeyId" />
</Arguments>
<RequestProcessingTime>0.232803106307983</RequestProcessingTime>
</OperationRequest>
- <Cart>
- <Request>
<IsValid>True</IsValid>
- <CartCreateRequest>
- <Items>
- <Item>
<ASIN>B000E73MO0</ASIN>
<Quantity>1</Quantity>
</Item>
- <Item>
<ASIN>B00005T3E4</ASIN>
<Quantity>1</Quantity>
</Item>
- <Item>
<ASIN>B000BOLJ64</ASIN>
<Quantity>1</Quantity>
</Item>
</Items>
</CartCreateRequest>
</Request>
<CartId>102-8451736</CartId>
<HMAC>8Ii25TILTMsE7n2zl=</HMAC>
<URLEncodedHMAC>8Ii25TILTMsE7n2zln%2BoVMt5Hn0%3D </URLEncodedHMAC>
<PurchaseURL>https://www.amazon.com/gp/cart/aws-merge.html?cart-
id=102-8451736%26associate-id=Mt5Hn0=
%26SubscriptionId=G2%26MergeCart=False</PurchaseURL>
- <SubTotal>
<Amount>9191</Amount>
<CurrencyCode>USD</CurrencyCode>
<FormattedPrice>$91.91</FormattedPrice>
</SubTotal>
- <CartItems>
- <SubTotal>
<Amount>9191</Amount>
<CurrencyCode>USD</CurrencyCode>
<FormattedPrice>$91.91</FormattedPrice>
</SubTotal>
- <CartItem>
<CartItemId>U2XH7SPFEHRQLD</CartItemId>
<ASIN>B000E73MO0</ASIN>
<MerchantId>ATVPDKIKX0DER</MerchantId>
<SellerId>A2R2RITDJNW1Q6</SellerId>
<SellerNickname>Amazon.com</SellerNickname>
<Quantity>1</Quantity>
<Title>Mrs. Meyer's Clean Day Counter Top Spray, Lavender, Case of 6
- 16 Ounce Bottles (96 Ounces)</Title>
<ProductGroup>Drugstore</ProductGroup>
- <Price>
<Amount>2754</Amount>
<CurrencyCode>USD</CurrencyCode>
<FormattedPrice>$27.54</FormattedPrice>
</Price>
- <ItemTotal>
<Amount>2754</Amount>
<CurrencyCode>USD</CurrencyCode>
<FormattedPrice>$27.54</FormattedPrice>
</ItemTotal>
</CartItem>
- <CartItem>
<CartItemId>U1QXVOR3X7NSH0</CartItemId>
<ASIN>B00005T3E4</ASIN>
<MerchantId>ATVPDKIKX0DER</MerchantId>
<SellerId>A2R2RITDJNW1Q6</SellerId>
<SellerNickname>Amazon.com</SellerNickname>
<Quantity>1</Quantity>
<Title>Duracell Ultra AAA Batteries - 8-Pack</Title>
<ProductGroup>Drugstore</ProductGroup>
- <Price>
<Amount>599</Amount>
<CurrencyCode>USD</CurrencyCode>
<FormattedPrice>$5.99</FormattedPrice>
</Price>
- <ItemTotal>
<Amount>599</Amount>
<CurrencyCode>USD</CurrencyCode>
<FormattedPrice>$5.99</FormattedPrice>
</ItemTotal>
</CartItem>
- <CartItem>
<CartItemId>U2BTS0V2OTNF7J</CartItemId>
<ASIN>B000BOLJ64</ASIN>
<MerchantId>ATVPDKIKX0DER</MerchantId>
<SellerId>A2R2RITDJNW1Q6</SellerId>
<SellerNickname>Amazon.com</SellerNickname>
<Quantity>1</Quantity>
<Title>Tide Free Powder Detergent, Case Pack, Four - 60 Load Boxes
(240 Loads)</Title>
<ProductGroup>Drugstore</ProductGroup>
- <Price>
<Amount>5838</Amount>
<CurrencyCode>USD</CurrencyCode>
<FormattedPrice>$58.38</FormattedPrice>
</Price>
- <ItemTotal>
<Amount>5838</Amount>
<CurrencyCode>USD</CurrencyCode>
<FormattedPrice>$58.38</FormattedPrice>
</ItemTotal>
</CartItem>
</CartItems>
</Cart>
</CartCreateResponse>

<<<<<<<<<<<<<<<<<<

elemPurchaseURL =
objXML.selectSingleNode("/CartCreateResponse/Cart/PurchaseURL")

If Not elemPurchaseURL is Nothing Then
Response.Redirect elemPurchaseURL.text
Else
Response.Write "Purchase URL not found"
End If

If you want to understand what selectSingleNode is doing you also need to
read w3schools XPath tutorial. However be aware that they've updated it to
reflect XPath 2.0 but MSXML only supports XPath 1.0. In fact by default
MSXML 3 use XSL pattern as a selection language. Since the query path in
this case is so simple this doesn't matter. However to use other features
of XPath you would need another setProperty call:-

objXML.setProperty "SelectionLanguage", "XPath"

or if you know your ISP has MSXML 6 installed use the .6.0 ProgIDs instead.


BTW, does anybody know why Outlook Express sometimes fails to indent quoted
text?


--
Anthony Jones - MVP ASP/ASP.NET


 
Reply With Quote
 
Billy
Guest
Posts: n/a
 
      08-20-2007
On Aug 19, 5:56 pm, "Anthony Jones" <(E-Mail Removed)> wrote:
> "Billy" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed) ups.com...
> On Aug 19, 4:59 am, "Anthony Jones" <(E-Mail Removed)> wrote:> "Billy" <(E-Mail Removed)> wrote in message
>
> >news:(E-Mail Removed) roups.com...

>
> I used the objXML.setProperty "ServerHTTPRequest", True right before
> the XML load and this worked - I recvd back the contents of the xmlns
> tag in my browser. Thank you!
>
> However, I really need to grab the PurchaseURL in tis XML (shown
> below) and submit it automatically to the browser. I suspect that I
> will use a Response.Redirect to submit the PurchaseURL, but I need to
> understand how to get to it first.
>
> I looked on the web for SlectSingleNode syntax and I've had a real
> hard time getting good information on it for beginners. I've also read
> through XML DOM in W3 Schools, but have yet to find out how the
> SelectSingleNode parameters works. I suspect that I'm using the
> correct function by using SelectSingleNode (If I'm wrong, please
> advise).
>
> I really just need to understand how to navigate through the nodes to
> grab what I want. Any examples would be appreciated.
>
> Here is the XML that I load:
>
> <?xml version="1.0" encoding="UTF-8" ?>
> - <CartCreateResponse xmlns="http://webservices.amazon.com/
> AWSECommerceService/2005-10-05">
> + <OperationRequest>
> - <HTTPHeaders>
> <Header Name="UserAgent" Value="Mozilla/4.0 (compatible; MSIE 7.0;
> Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.0.3705; .NET CLR
> 1.1.4322)" />
> </HTTPHeaders>
> <RequestId>1Y86JP8EYYVME4ZVD8ZG</RequestId>
> - <Arguments>
> <Argument Name="Item.1.ASIN" Value="B000E73MO0" />
> <Argument Name="Service" Value="AWSECommerceService" />
> <Argument Name="Item.2.ASIN" Value="B00005T3E4" />
> <Argument Name="Item.1.Quantity" Value="1" />
> <Argument Name="Item.2.Quantity" Value="1" />
> <Argument Name="Operation" Value="CartCreate" />
> <Argument Name="Item.3.Quantity" Value="1" />
> <Argument Name="Item.3.ASIN" Value="B000BOLJ64" />
> <Argument Name="AWSAccessKeyId" Value="ACCESSKeyId" />
> </Arguments>
> <RequestProcessingTime>0.232803106307983</RequestProcessingTime>
> </OperationRequest>
> - <Cart>
> - <Request>
> <IsValid>True</IsValid>
> - <CartCreateRequest>
> - <Items>
> - <Item>
> <ASIN>B000E73MO0</ASIN>
> <Quantity>1</Quantity>
> </Item>
> - <Item>
> <ASIN>B00005T3E4</ASIN>
> <Quantity>1</Quantity>
> </Item>
> - <Item>
> <ASIN>B000BOLJ64</ASIN>
> <Quantity>1</Quantity>
> </Item>
> </Items>
> </CartCreateRequest>
> </Request>
> <CartId>102-8451736</CartId>
> <HMAC>8Ii25TILTMsE7n2zl=</HMAC>
> <URLEncodedHMAC>8Ii25TILTMsE7n2zln%2BoVMt5Hn0%3D </URLEncodedHMAC>
> <PurchaseURL>https://www.amazon.com/gp/cart/aws-merge.html?cart-
> id=102-8451736%26associate-id=Mt5Hn0=
> %26SubscriptionId=G2%26MergeCart=False</PurchaseURL>
> - <SubTotal>
> <Amount>9191</Amount>
> <CurrencyCode>USD</CurrencyCode>
> <FormattedPrice>$91.91</FormattedPrice>
> </SubTotal>
> - <CartItems>
> - <SubTotal>
> <Amount>9191</Amount>
> <CurrencyCode>USD</CurrencyCode>
> <FormattedPrice>$91.91</FormattedPrice>
> </SubTotal>
> - <CartItem>
> <CartItemId>U2XH7SPFEHRQLD</CartItemId>
> <ASIN>B000E73MO0</ASIN>
> <MerchantId>ATVPDKIKX0DER</MerchantId>
> <SellerId>A2R2RITDJNW1Q6</SellerId>
> <SellerNickname>Amazon.com</SellerNickname>
> <Quantity>1</Quantity>
> <Title>Mrs. Meyer's Clean Day Counter Top Spray, Lavender, Case of 6
> - 16 Ounce Bottles (96 Ounces)</Title>
> <ProductGroup>Drugstore</ProductGroup>
> - <Price>
> <Amount>2754</Amount>
> <CurrencyCode>USD</CurrencyCode>
> <FormattedPrice>$27.54</FormattedPrice>
> </Price>
> - <ItemTotal>
> <Amount>2754</Amount>
> <CurrencyCode>USD</CurrencyCode>
> <FormattedPrice>$27.54</FormattedPrice>
> </ItemTotal>
> </CartItem>
> - <CartItem>
> <CartItemId>U1QXVOR3X7NSH0</CartItemId>
> <ASIN>B00005T3E4</ASIN>
> <MerchantId>ATVPDKIKX0DER</MerchantId>
> <SellerId>A2R2RITDJNW1Q6</SellerId>
> <SellerNickname>Amazon.com</SellerNickname>
> <Quantity>1</Quantity>
> <Title>Duracell Ultra AAA Batteries - 8-Pack</Title>
> <ProductGroup>Drugstore</ProductGroup>
> - <Price>
> <Amount>599</Amount>
> <CurrencyCode>USD</CurrencyCode>
> <FormattedPrice>$5.99</FormattedPrice>
> </Price>
> - <ItemTotal>
> <Amount>599</Amount>
> <CurrencyCode>USD</CurrencyCode>
> <FormattedPrice>$5.99</FormattedPrice>
> </ItemTotal>
> </CartItem>
> - <CartItem>
> <CartItemId>U2BTS0V2OTNF7J</CartItemId>
> <ASIN>B000BOLJ64</ASIN>
> <MerchantId>ATVPDKIKX0DER</MerchantId>
> <SellerId>A2R2RITDJNW1Q6</SellerId>
> <SellerNickname>Amazon.com</SellerNickname>
> <Quantity>1</Quantity>
> <Title>Tide Free Powder Detergent, Case Pack, Four - 60 Load Boxes
> (240 Loads)</Title>
> <ProductGroup>Drugstore</ProductGroup>
> - <Price>
> <Amount>5838</Amount>
> <CurrencyCode>USD</CurrencyCode>
> <FormattedPrice>$58.38</FormattedPrice>
> </Price>
> - <ItemTotal>
> <Amount>5838</Amount>
> <CurrencyCode>USD</CurrencyCode>
> <FormattedPrice>$58.38</FormattedPrice>
> </ItemTotal>
> </CartItem>
> </CartItems>
> </Cart>
> </CartCreateResponse>
>
> <<<<<<<<<<<<<<<<<<
>
> elemPurchaseURL =
> objXML.selectSingleNode("/CartCreateResponse/Cart/PurchaseURL")
>
> If Not elemPurchaseURL is Nothing Then
> Response.Redirect elemPurchaseURL.text
> Else
> Response.Write "Purchase URL not found"
> End If
>
> If you want to understand what selectSingleNode is doing you also need to
> read w3schools XPath tutorial. However be aware that they've updated it to
> reflect XPath 2.0 but MSXML only supports XPath 1.0. In fact by default
> MSXML 3 use XSL pattern as a selection language. Since the query path in
> this case is so simple this doesn't matter. However to use other features
> of XPath you would need another setProperty call:-
>
> objXML.setProperty "SelectionLanguage", "XPath"
>
> or if you know your ISP has MSXML 6 installed use the .6.0 ProgIDs instead.
>
> BTW, does anybody know why Outlook Express sometimes fails to indent quoted
> text?
>
> --
> Anthony Jones - MVP ASP/ASP.NET


Anthony,

Thank you. I will try your code and recommended reading and post the
results.

For OL2003 ( I suspect similar options in OE)......

Play with these options.....

Tools/Prefences/EMail Options
See sections "On Replies and Forwards"
When Replying to a Message: Include and Indent Orginal Message Text
When Fowarding a Message: Include and Indent Orginal Message Text

 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      08-20-2007
"Billy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> On Aug 19, 5:56 pm, "Anthony Jones" <(E-Mail Removed)> wrote:
> > "Billy" <(E-Mail Removed)> wrote in message
> >
> > or if you know your ISP has MSXML 6 installed use the .6.0 ProgIDs

instead.
> >
> > BTW, does anybody know why Outlook Express sometimes fails to indent

quoted
> > text?
> >
> > --
> > Anthony Jones - MVP ASP/ASP.NET

>
> Anthony,
>
> Thank you. I will try your code and recommended reading and post the
> results.
>
> For OL2003 ( I suspect similar options in OE)......
>
> Play with these options.....
>
> Tools/Prefences/EMail Options
> See sections "On Replies and Forwards"
> When Replying to a Message: Include and Indent Orginal Message Text
> When Fowarding a Message: Include and Indent Orginal Message Text
>


Yes I've got those settings already it's just that with some messages it
just fails to kick in. Wierd.

--
Anthony Jones - MVP ASP/ASP.NET


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How do i extract vidios when winrar wont extract them??? help plzzzzzzzz smuttdog@sc.rr.com Computer Support 2 12-23-2007 07:03 AM
Malformed URL by using Page.Request.Url.ToString() - why? =?Utf-8?B?QXhlbCBEYWhtZW4=?= ASP .Net 3 04-18-2007 06:45 AM
Is there a class or method to construct url args or extract url args? Ken Varn ASP .Net 2 06-22-2005 12:26 PM
Tools to extract data from SQL database and convert it into XML & insert XML data into SQL databases Harry Zoroc XML 1 07-12-2004 10:10 PM



Advertisments