Ah-ha! - you meant xml-match inside Webit!? <br><br>S.<br><br><br><div class="gmail_quote">On Jan 8, 2008 2:50 PM, Stephen De Gabrielle <<a href="mailto:stephen@degabrielle.name">stephen@degabrielle.name</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Yeah, thanks for raising that. <br><br>I think I've seen this in the test cases; I think order-independent list pattern in plt-match is
<br> (list-no-order pat ... lvp) Match arguments in a list in any order
<br>, but I haven't tried it yet.<br><br>I'm using Matt's example as a base at the moment, and just hoping my data is ordered consistently, not because the schema/dtd requires it, but because it is machine generated. (probably too much of an assumption)
<br><br>By xml-match so you mean sxml-match? if not please tell me, as I have missed it.<br><br>Both sxml-match and SXPath seem to cover all the bases, but I am trying them one at a time.<br><br>Cheers, <br><br>Stephen<br>
<br><br><div class="gmail_quote"><div><div></div><div class="Wj3C7c">On Jan 8, 2008 2:22 PM, Dave Gurnell <<a href="mailto:d.j.gurnell@gmail.com" target="_blank">d.j.gurnell@gmail.com</a>> wrote:<br></div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div><div></div><div class="Wj3C7c"><div>My two cents on XML matching:</div><div><br></div>I tend to find match and plt-match to be a little restrictive for XML pattern matching. The classic example of this is attributes on elements, which can arrive in any order. For example:
<div><br></div><div><font face="Monaco"> '(a (@ [href "<a href="http://www.example.com" target="_blank">http://www.example.com</a>"]</font></div><div><font face="Monaco"> [target "_new"])
</font></div><div><font face="Monaco"> "Example web site")</font></div><div><font face="Monaco"><br></font></div><div>is equivalent to:</div><div><br></div></div></div><div><div><div></div><div class="Wj3C7c">
<font face="Monaco"><span><div><font face="Monaco">
'(a (@ [target "_new"]</font></div><div><font face="Monaco"> [href "<a href="http://www.example.com" target="_blank">http://www.example.com</a>"])</font></div><div><font face="Monaco">
"Example web site")</font></div><div><font face="Monaco"><br></font></div></span></font></div></div><div><div><div></div><div class="Wj3C7c"><div>but you have to match against it with two clauses like this:
</div><div><br></div></div></div><div><div><div></div><div class="Wj3C7c"><div><font face="Monaco">
(match link</font></div><div><font face="Monaco"> [`(a (@ [target ,target] [href ,href]) ,text)</font></div><div><font face="Monaco"> ...]</font></div><div><font face="Monaco"> [`(a (@ [href ,href] [target ,target]) ,text)
</font></div><div><font face="Monaco"> ...])</font></div><div><font face="Monaco"><br></font></div><div>or using nested matches, one for the elements and one for the attributes.</div><div><br></div><div><div>Perhaps there's an order-independent list pattern in plt-match that I don't know about? If not, the XML matching library is probably better for this kind of thing. However, xml-match it has its own limitations too (I can't remember these off the top of my head: I just remember that writing
delicious.plt wasn't as straightforward as I might have hoped).</div></div><div><br></div><div>I haven't tried SXPath yet.</div><div><br></div><div>Cheers,</div></div></div><font color="#888888"><div><br></div><div>
-- Dave</div>
</font></div></div></div></div><div class="Ih2E3d"><br>_________________________________________________<br> For list-related administrative tasks:<br> <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">
http://list.cs.brown.edu/mailman/listinfo/plt-scheme
</a><br><br></div></blockquote></div><br><br clear="all"><br>-- <div><div></div><div class="Wj3C7c"><br>Cheers,<br><br>Stephen<br><br><br><br>--<br>Stephen De Gabrielle<br><a href="mailto:s.degabrielle@ucl.ac.uk" target="_blank">
s.degabrielle@ucl.ac.uk</a><br>Telephone +44 (0)20 7679 5242 (x45242)
<br>Mobile 079 851 890 45<br><a href="http://www.uclic.ucl.ac.uk/annb/MaSI.html" target="_blank">http://www.uclic.ucl.ac.uk/annb/MaSI.html</a><br>University College London Interaction Centre<br>Remax House - 31/32 Alfred Place
<br>London - WC1E 7DP<br><br>"There's an old story about the person who wished his computer were as easy to use as his telephone. That wish has come true, since I no longer know how to use my telephone. " -- Bjarne Stroustrup
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Cheers,<br><br>Stephen<br><br><br><br>--<br>Stephen De Gabrielle<br><a href="mailto:s.degabrielle@ucl.ac.uk">s.degabrielle@ucl.ac.uk</a><br>Telephone +44 (0)20 7679 5242 (x45242)
<br>Mobile 079 851 890 45<br><a href="http://www.uclic.ucl.ac.uk/annb/MaSI.html">http://www.uclic.ucl.ac.uk/annb/MaSI.html</a><br>University College London Interaction Centre<br>Remax House - 31/32 Alfred Place
<br>London - WC1E 7DP<br><br>"There's an old story about the person who wished his computer were as easy to use as his telephone. That wish has come true, since I no longer know how to use my telephone. " -- Bjarne Stroustrup
<br>