[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Screen-scraping with XQuery

Michael Kay mhk at mhk.me.uk
Fri Apr 1 13:00:21 PST 2005


xquery screen scraping
> Good question. I guess the issue is more "how can I embed an XQuery
> program within an XML document" than directly related to XPL. What
> happens if you escape the internal opening brackets within attributes:
> 
> <a href="{concat("a", &lt;B>thing&lt;/B>}"/>
> 
> Does this make a difference for XQuery?

Yes, it does. That's not a legal query any more. XQuery only allows &lt; in
character content or in string literals, not in places where an operator or
element constructor might be expected.

I guess it's no big deal for XPL if you only support the subset of XQuery
that's well-formed XML. It's easy enough for users to avoid such constructs
(and probably good practice).

More of a practical issue are the operators such as "<", "<=" and "<<" which
in XQuery syntax must be unescaped. It's harder to avoid using these,
although you can always invert the operands and use ">", ">=", ">>".

(I'm actually trying to write a WG proposal on embedding XQuery in XML at
the moment. XPL is a good use case for it. I'm not happy with either XQueryX
or the "trivial embedding" where all "<" characters are escaped. I would
like to see something defined along the lines that XPL uses, but it
obviously needs to be specified more precisely for a spec than one often
does in a product.)

Michael Kay


> 
> -Erik
> 
> Michael Kay wrote:
>  > One thing this reminds me of: do you have any formal definition of 
> how you
>  > embed the XQuery syntax in XPL? For example, how do you 
> handle constructs
>  > like
>  >
>  > <a href="{concat("a", <B>thing</B>}"/>
>  >
>  > which are valid in XQuery but not in XML?
>  >
>  > Michael Kay
>  > http://www.saxonica.com/
> _______________________________________________
> http://xquery.com/mailman/listinfo/talk
> http://xquery.com/mailman/listinfo/talk
> 




PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.