[XQZone General] Saving an HTML file with DOCTYPE
David Sewell
dsewell at virginia.edu
Thu Oct 28 07:35:06 PDT 2004
Mike,
This works beautifully. I needed the .xqy script to write a valid static
XHTML file to the filesystem, and now it's doing it, DOCTYPE declaration
and all. Thanks!
David
On Wed, 27 Oct 2004, Michael Blakeley wrote:
> > This doesn't really cover David's original request (to save the document on
> > the local filesystem).
[...]
> > I had a third option, but now I forgot :)
>
> Perhaps this?
>
> let $e := <test/>
> let $n := document {
> '<?xml version="1.0"?>',
> $e
> }
> return (
> xdmp:save("/tmp/test", $n),
> current-dateTime()
> )
>
> $ cat /tmp/test
> <?xml version="1.0"?><test/>
>
> This is basically the same as your XDBC option, but using xdmp:save(). The
> resulting document should have a root text node, rather than a root element:
> essentially, you've converted the xml in $e to text. You can do similar things
> with binary nodes, too.
--
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: dsewell at virginia.edu Tel: +1 434 924 9973
Web: http://www.ei.virginia.edu/
More information about the General
mailing list