Re: Xmlsearch Xpath
You might find this handy then: http://www.cfdev.com/xml/xpath/ Adam Haskell wrote: A little while ago someone, sorry I forget who, had asked about sharing links to good Xpath tutorials on the web related to coldfusion, the question basically went unanswered. I started looking around and noticed there weren't any that I could find. So I set out to change that and started digging around Xpath tutorials and reading W3C's specs, a few days later I have what might actually be the semblance of a tutorial. Before I release it to the masses, and get pummeled with critique, I was hoping I could get a few brave volunteers to read it over and give me some feedback as to what I could change/include. Any takers? Adam H [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: Xmlsearch Xpath
Yeah been there thats about the only thing I found anywhere :( Adam On Fri, 20 Aug 2004 11:53:08 -0400, Pete Freitag [EMAIL PROTECTED] wrote: You might find this handy then: http://www.cfdev.com/xml/xpath/ Adam Haskell wrote: A little while ago someone, sorry I forget who, had asked about sharing links to good Xpath tutorials on the web related to coldfusion, the question basically went unanswered. I started looking around and noticed there weren't any that I could find. So I set out to change that and started digging around Xpath tutorials and reading W3C's specs, a few days later I have what might actually be the semblance of a tutorial. Before I release it to the masses, and get pummeled with critique, I was hoping I could get a few brave volunteers to read it over and give me some feedback as to what I could change/include. Any takers? Adam H [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Xmlsearch Xpath
A little while ago someone, sorry I forget who, had asked about sharing links to good Xpath tutorials on the web related to coldfusion, the question basically went unanswered. I started looking around and noticed there weren't any that I could find. So I set out to change that and started digging around Xpath tutorials and reading W3C's specs, a few days later I have what might actually be the semblance of a tutorial. Before I release it to the masses, and get pummeled with critique, I was hoping I could get a few brave volunteers to read it over and give me some feedback as to what I could change/include. Any takers? Adam H [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
XMLSearch Xpath Question
OK so I have been able to use XMLSearch filter by attributes, however I want to be able to filter by the actual text between tags...the funny thing is all of my CFMX books only filter by attributes in their examples. I know this has to be really easy, but I am not sure how to write an XPath statement to filter by the text between tags...For example in the XML document below I want to just be able to pull those courses with FS between the subject tags, this is what I thought would work but it gives me nice little empy array. Thank you in advance My Xpath statement: resultsXML=XMLSearch(IDcoursesXML, '/catalog/course[subject=FS]') A snippet of the XML I am trying to search/filter: --- ?xml version=1.0? catalog course section DS-202/section subject DS/subject title ![CDATA[ Intro Disability Studies ]] /title description ![CDATA[ This course will explore the social, cultural, and ethical issues surrounding the experience of disability. It is co-taught by faculty from the English Department and the School of Physical Therapy. Prerequisite: sophomore standing. 2 hours. Thompson, Cicirello, Medeiros. ]] /description credithours ![CDATA[2.00 ]] /credithours /course course section DS-400/section subjectDS/subject title ![CDATA[ Disability Studies in Theory Practice ]] /title description ![CDATA[ This course, a capstone for students in the Disability Studies minor, is a combination of seminar and field work. (The field work may be in the form on internships or service-learning.) In this course, students will review major concepts covered in prior Disability Studies classes. This review will be conducted in light of experiences and knowledge acquired working at appropriate sites in the local community. 2 hours. Thompson, Cicirello, Medeiros. ]] /description credithours ![CDATA[2.00 ]]/credithours /course course section FS-150/section subjectFS/subject title ![CDATA[ Personal Self Defense Women]] /title description ![CDATA[ Women's Self Defense. See Human Performance department for course description. 1 hour. Staff. ]] /description credithours ![CDATA[ 1.00 ]] /credithours /course --- [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: XMLSearch Xpath Question
This should work: /catalog/course/subject[text()='DS'] Even better, you could trim the text before comparing it: /catalog/course/subject[normalize-space(text())='DS'] You can find an excellent tutorial here: http://www.w3schools.com/xpath/default.asp A great book: http://www.oreilly.com/catalog/xpathpointer Handy tools for testing XPath expressions: http://www.purpletech.com/xpe/index.jsp http://www.topxml.com/xpathvisualizer/ Hope it will help Massimo Foti http://www.massimocorner.com Co-Author of Dreamweaver MX 2004 Magic: http://www.dwmagic.com/ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]