Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
samb1 #1
Could I use XPATH?
Im currently using the XML doc below. At the moment I am pulling the first
'site index' value out, and using that value for a CFHTTP request. I then use
the 'parse name' value, which is a regexp, on the CFHTTP result to parse out a
list of links. I then want to loop over each web link with cfhttp and use the
'detailed parsers' in turn to parse various details on each page. Once each
detailed parser has finished id like to call the next 'site index' element and
start the process over. Would XPATH be more efficient than just using basic
methods to search an XML doc? If so could someone show me an example as all
other examples ive looked at differ in their structure, compared to my xml
file.....thanks in advance <?xml version='1.0' encoding='iso-8859-1'?>
<listings> <site index='http://www.rspb.org.uk/vacancies/index.asp'> <parse
name='link' re='<\s*td\s*>\s*<\s*A\s*(.*?)HREF\s*=\s*[''](.*?)[''](.*?)\s*>'/>
<detail-page-parsers> <parse name='title' re='<\s*H2>\s*(.*?)>(.*?)</H2>' />
<parse name='location' re='<p[\s]id=['']location['']>(.*?)</p>' /> <parse
name='salary' re='<\s*/H3>(.*?)?\s*(.*?)\s*</DIV>' /> <parse
name='hoursContactInfo' re='(full|part)[\s]time' /> <parse name='closingDate'
re='\s[[igit:]][[igit:]][[:space:]][[rint:]]+[[igit:]][[igit:]][[igit:]][[igit:]
] ' /> </detail-page-parsers> </site> <site
index='http://www.english-nature.org.uk/news/jobs.asp'> <parse name='link'
re='HREF\s*=\s*[''](.*?)['']'/> <detail-page-parsers> <parse name='title'
re='<td\s*class=['']head['']>(.*?)</td>' /> <parse name='location'
re='Based[\s]*at[\s]*[[rint:]]+' /> <parse name='salary'
re='?[[igit:]][[igit:]][[unct:]][[igit:]][[igit:]][[igit:]]' /> <parse
name='hoursContactInfo' re='(full|part)-time' /> <parse name='closingDate'
re='<b>[[igit:]][[igit:]][[:space:]][[rint:]]+[[igit:]][[igit:]][[igit:]][[igit:
]]' /> </detail-page-parsers> </site> <site
index='http://www.ccw.gov.uk/vacancies/index.cfm?'> <parse name='link'
re='HREF\s*=\s*['']/vacancies(.*?)\s*>'/> <detail-page-parsers> <parse
name='title' re='</TH>\s*<td>\s*[a-z](.*?)</td>' /> <parse name='salary'
re='?[0-9][0-9][^[:alnum:]][0-9][0-9][0-9][^[:alnum:]][0-9][0-9]' /> <parse
name='hoursContactInfo' re='(full|part)-time' /> <parse name='closingDate'
re='[[igit:]][[igit:]][[unct:]][[igit:]][[igit:]][[unct:]][[igit:]][[igit:]][[ig
it:]][[igit:]]' /> </detail-page-parsers> </site> </listings>
samb1 Guest
-
XPath(xpath4as2)
Has anyone here been using the xpath4as2 package? Just curious how much more overhead increase you have seen and if it may be better to hand code... -
xpath question!
Hi there, im writing code to search an xml document using the xfactorstudios XPATH library. I want to know if it is possible to extract the... -
xmlsearch and xpath
Hallo all, i have a small problem in xmlsearch and i am new to coldfusion.... The below is the xupdate packet from flash send to coldfusion... -
XPath and HTML
Is there a library out there that let's me parse HTML and use XPath expressions against it? What is it? Thanks -- David Corbin... -
XPath with PHP Dom's
Is there any way I can use XPath on a XML DOM object. I have an XML file that I parse using XML DOM, but I need to find a node with a specific ID....



Reply With Quote

