Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some more questions



Hi Michel,

But when i translate the above line of code to:
let $resultlist := data-match-all($html,"<TR><TD>","<TR><TD>   </TD></TR>",false(),false())
I don't get any results anymore. I just don't understand why. Does the '&nbsp' thing also have to be translated?

Perhaps you could provide some more information, for example what data you're matching against. I put the following in the test channel:


let $test := "<tr><td>testing<tr><td> </td></ tr>"
let $results := data-match- all($test,"<tr><td>","<tr><td> </ td></tr>",false(),false())
let $log := msg($results[1]/string())


and it worked just fine.

Where can i find information about what is the difference between:

I'd strongly suggest looking through the tutorials and references at http://www.zvon.org/. I've posted this url before; make sure to check the list archives first. (also: googling for the words "xpath" and "tutorial" returns zvon as the first match... hmmmm)


(1) let $html := ($html//BR) AND let $html := ($html/BR) -----> 1 forward slash and 2 forward slashes

Two slashes means "get all the BRs that follow anywhere after the $html node", whereas one slash is "get the BRs that directly follow the $html node."


(2) $html/./ AND $html/../ ------> 1 dot and 2 dots

One dot is the current context node(s), two dots is the node(s) above it. Think of directory paths.


(3) why do you say $html/BR/text() and not $html/BR/text(.) ---> with a dot in between

Because the text() function doesn't take any arguments. Check out the zvon reference for details on the xpath functions. Some functions, such as string() optionally take an argument or default to the current node. This might be where you're getting confused.


Cheers,
--Sarah
_______________________________________________
sherlock-channel-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/sherlock-channel-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Some more questions (From: Michel Beaucourt <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.