|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] XHTML namespace and doc() functionDavid Sewell dsewell at virginia.eduWed Jul 7 17:20:25 PDT 2004
I've just been wrestling with a problem that it turns out was discussed
last year on this list, in a brainteaser posted by Jason Hunter:
http://xquery.com/pipermail/talk/2003-May/000009.html
The basic issue is that we want to generate valid XHTML with XQuery code
that makes use of doc() to retrieve things. So we started out trying
something like this:
default element namespace = "http://www.w3.org/1999/xhtml"
<html>
<head><title>Test</title></head>
<body>
{ doc("DPM0029.xml")//body//p }
</body>
</html>
and discovered the problem that the doc() function here returns null
because it is looking in the XHTML namespace instead of for a local URI,
as someone else pointed out in answer to the brainteaser.
Nobody suggested what the best workaround is, however. Of course we
could omit the XHTML namespace reference and output a bare <html> element,
but let's say we want to be W3C-correct and include it. Are we always
going to have to "shield" doc() calls by putting them in variables
and/or functions external to the element constructors? Is there another
technique? (If not, do other navigation functions like id() have similar
issues?)
Thanks for helping a newbie,
David S.
--
David Sewell, Editorial and Technical Manager
Electronic Imprint, The University of Virginia Press
PO Box 400318, Charlottesville, VA 22904-4318 USA
Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903
Email: http://xquery.com/mailman/listinfo/talk Tel: +1 434 924 9973
Web: http://www.ei.virginia.edu/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








