XML question

Post Reply
gerry.odea
Posts: 98
Joined: Fri Sep 19, 2008 9:33 am

XML question

Post by gerry.odea »

I'm trying to pull in the Bing xml feed and I'm running into a problem. I have version 2.6 so I can't just pull in the XML easy I have to do it the hard way... Here's a sample of the XML

<web:WebResult>
<web:Title>New & Used Cars for Sale, Auto Dealers, Car Reviews and Car Finance ...</web:Title>
<web:Description>Search 2.6 million new & used car listings, price a new car, get a dealer quote, read expert reviews, or sell your car at thousands over trade-in.</web:Description>
<web:Url>http://www.cars.com/</web:Url>
<web:CacheUrl>http://cc.bingj.com/cache.aspx?q=cars&d ... b:CacheUrl>
<web:DisplayUrl>www.cars.com</web:DisplayUrl>
<web:DateTime>2009-09-10T18:17:47Z</web:DateTime>
- <web:DeepLinks>
- <web:DeepLink>
<web:Title>Buy</web:Title>
<web:Url>http://www.cars.com/go/buyIndex.jsp?aff ... l</web:Url>
</web:DeepLink>
- <web:DeepLink>
<web:Title>Sell</web:Title>
<web:Url>http://siy.cars.com/siy/index.jsp?aff=n ... r</web:Url>
</web:DeepLink>
- <web:DeepLink>
<web:Title>Research</web:Title>
<web:Url>http://www.cars.com/go/crp/index.jsp?af ... l</web:Url>
</web:DeepLink>
- <web:DeepLink>
<web:Title>Advice</web:Title>
<web:Url>http://www.cars.com/go/advice/index.jsp ... l</web:Url>
</web:DeepLink>
- <web:DeepLink>
<web:Title>About</web:Title>
<web:Url>http://www.cars.com/go/about/index.jsp? ... l</web:Url>
</web:DeepLink>
- <web:DeepLink>
<web:Title>Contact</web:Title>
<web:Url>http://www.cars.com/go/about/us.jsp?aff ... t</web:Url>
</web:DeepLink>
- <web:DeepLink>
<web:Title>Careers</web:Title>
<web:Url>https://hostedjobs.openhire.com/epostin ... 7</web:Url>
</web:DeepLink>
</web:DeepLinks>
</web:WebResult>


Here's what I have in my texis script:


<$imports1='
recdelim >><rs:Results>
multiple
field Title varchar(80) />><rs:RelatedSearchResult>\P=!<rs:RelatedSearchResult>+ ""
'>
<$imports2='
recdelim >><web:WebResult>
multiple
field Title varchar(80) />><web:WebResult><web:Title>\P=!</web:Title><web:DeepLinks>+ ""
field Abstract varchar(80) />><web:Description>\P=!</web:Description>+ ""
field Link varchar(40) />><web:Url>\P=!</web:Url>+ ""
field Cache varchar(40) />><web:CacheUrl>\P=!</web:CacheUrl>+ ""
field ShowURL varchar(40) />><web:DisplayUrl>\P=!</web:DisplayUrl>+ ""
field Date varchar(40) />><web:DateTime>\P=!</web:DateTime>+ ""
field DeepLinks varchar(40) />><web:DeepLinks>\P=!</web:DeepLinks>+ ""
'>

Here's the issue.. the script is pulling in <web:Title> and <web:Url> from the <web:DeepLinks><web:DeepLink> into the Title field of the texis script and I don't want it. How can I make sure that it doesn't do that and ignores the <web:Title> and <web:Url> under <web:DeepLinks><web:DeepLink> but does bring in <web:Title> and <web:Url> from <web:WebResult>

Thank you - Gerry
gerry.odea
Posts: 98
Joined: Fri Sep 19, 2008 9:33 am

XML question

Post by gerry.odea »

actually this is what I currently have in my texis script....disregard the one above.. I was trying anything to make it work.

<$imports1='
recdelim >><rs:Results>
multiple
field Title varchar(80) />><rs:RelatedSearchResult>\P=!<rs:RelatedSearchResult>+ ""
'>
<$imports2='
recdelim >><web:WebResult>
multiple
field Title varchar(80) />><web:Title>\P=!</web:Title>+ ""
field Abstract varchar(80) />><web:Description>\P=!</web:Description>+ ""
field Link varchar(40) />><web:Url>\P=!</web:Url>+ ""
field Cache varchar(40) />><web:CacheUrl>\P=!</web:CacheUrl>+ ""
field ShowURL varchar(40) />><web:DisplayUrl>\P=!</web:DisplayUrl>+ ""
field Date varchar(40) />><web:DateTime>\P=!</web:DateTime>+ ""
'>
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

XML question

Post by John »

You may have been on the right track before, e.g.

field Title varchar(80) />><web:WebResult>=\space*<web:Title>\P=!</web:Title>+ ""

May work to pull the web:Title out that immediately follows the web:WebResult.
John Turnbull
Thunderstone Software
gerry.odea
Posts: 98
Joined: Fri Sep 19, 2008 9:33 am

XML question

Post by gerry.odea »

No that didn't work either, because it's pulling in the last <web:Url> under <web:DeepLinks><web:DeepLink> but it is pulling in the correct <web:Title> so that part is working.
gerry.odea
Posts: 98
Joined: Fri Sep 19, 2008 9:33 am

XML question

Post by gerry.odea »

go it just needed to add

field Link varchar(40) />></web:Description>=\space*<web:Url>\P=!</web:Url>+ ""

Thanks John!
Post Reply