document() and redirects?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

document() and redirects?

Norman Walsh-2
I'm surprised that this stylesheet fails:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">

<xsl:output method="xml" encoding="utf-8" indent="no"
            omit-xml-declaration="yes"/>

<xsl:template match="/">
  <xsl:variable name="rdf"
  select="document('http://purl.org/dc/elements/1.1/')"/>
<!-- select="document('http://dublincore.org/2003/03/24/dces#')"/>-->
  <xsl:copy-of select="$rdf"/>
</xsl:template>

</xsl:stylesheet>

It reports:

Recoverable error
Failure reading http://purl.org/dc/elements/1.1/: http://dublincore.org/2003/03/24/dces#

So it appears to have seen the redirect. But if you attempt to load the
redirected-to URI directly, it works fine.

                                        Be seeing you,
                                          norm

--
Norman Walsh <[hidden email]> | 'I have done that,' says my memory. 'I
http://nwalsh.com/            | cannot have done that'--says my pride,
                              | and remains adamant. At last--memory
                              | yields.-- Nietzsche

attachment0 (194 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: document() and redirects?

George Cristian Bina
Hi Norm,

This seems to depend on the http protocol implementation. In oXygen for
instance we overwrite the default Java http support to provide support
also for WebDAV and from oXygen your stylesheet works without problems
as we handle redirects.

I tested also from the command line and it works ok for me, java version
reports:
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode)

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Norman Walsh wrote:

> I'm surprised that this stylesheet fails:
>
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>                 version="1.0">
>
> <xsl:output method="xml" encoding="utf-8" indent="no"
>    omit-xml-declaration="yes"/>
>
> <xsl:template match="/">
>   <xsl:variable name="rdf"
>   select="document('http://purl.org/dc/elements/1.1/')"/>
> <!-- select="document('http://dublincore.org/2003/03/24/dces#')"/>-->
>   <xsl:copy-of select="$rdf"/>
> </xsl:template>
>
> </xsl:stylesheet>
>
> It reports:
>
> Recoverable error
> Failure reading http://purl.org/dc/elements/1.1/: http://dublincore.org/2003/03/24/dces#
>
> So it appears to have seen the redirect. But if you attempt to load the
> redirected-to URI directly, it works fine.
>
>                                         Be seeing you,
>                                           norm
>


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: document() and redirects?

Michael Kay
Yes: Saxon relies entirely on the Java VM to dereference URIs. If your Java
VM can do it (and is configured to do it) then Saxon can do it, and vice
versa.

This one works for me when run in Livingston on a Thursday afternoon using a
Java version that calls itself 1.5.0 though I believe we're supposed to call
it 5.0

Michael Kay
http://www.saxonica.com/
 

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of
> George Cristian Bina
> Sent: 08 September 2005 14:23
> To: [hidden email]
> Subject: Re: [saxon] document() and redirects?
>
> Hi Norm,
>
> This seems to depend on the http protocol implementation. In
> oXygen for
> instance we overwrite the default Java http support to
> provide support
> also for WebDAV and from oXygen your stylesheet works without
> problems
> as we handle redirects.
>
> I tested also from the command line and it works ok for me,
> java version
> reports:
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode)
>
> Best Regards,
> George
> ---------------------------------------------------------------------
> George Cristian Bina
> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
> http://www.oxygenxml.com
>
>
> Norman Walsh wrote:
> > I'm surprised that this stylesheet fails:
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >                 version="1.0">
> >
> > <xsl:output method="xml" encoding="utf-8" indent="no"
> >    omit-xml-declaration="yes"/>
> >
> > <xsl:template match="/">
> >   <xsl:variable name="rdf"
> >   select="document('http://purl.org/dc/elements/1.1/')"/>
> > <!--
> select="document('http://dublincore.org/2003/03/24/dces#')"/>-->
> >   <xsl:copy-of select="$rdf"/>
> > </xsl:template>
> >
> > </xsl:stylesheet>
> >
> > It reports:
> >
> > Recoverable error
> > Failure reading http://purl.org/dc/elements/1.1/: 
> http://dublincore.org/2003/03/24/dces#
> >
> > So it appears to have seen the redirect. But if you attempt
> to load the
> > redirected-to URI directly, it works fine.
> >
> >                                         Be seeing you,
> >                                           norm
> >
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development
> Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams *
> Testing & QA
> Security * Process Improvement & Measurement *
> http://www.sqe.com/bsce5sf
> _______________________________________________
> saxon-help mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help