Static files not accessed ?

Wednesday, 25 May 2016 · 6 messages · last reply 31 May 2016
MI
Maud Ingarao25 May 2016 17:05 #
Hello dear friends Since we upgraded to 8.3 or 8.4, we have strange behaviours with static files. For example, this file cannot be accessed when called from another xsl (include or import) as shown in the logs : [GET] http://rey.huma-num.fr/inventaire/Rey17470124; Stopped at /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/mappings/htmlWrapping.xqm, 168/33: [bxerr:BXSL0001] Error on line 7 column 78 of tei2html-fiche.xsl: XTSE0165: I/O error reported by XML parser processing http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl: Server returned HTTP response code: 502 for URL: http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl Stack Trace: - /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/mappings/htmlWrapping.xqm, 78/47 - /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/models/synopsx.xqm, 168/49 - /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/workspace/rey/_restxq/rey.xqm, 443/43 So is it called in the other xsl :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="3.0"
    xmlns="http://www.w3.org/1999/xhtml"
   xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs">
   <xsl:output method="xml" encoding="UTF-8" indent="no"
omit-xml-declaration="yes"/>
   <xsl:import
href="http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl"/>
[...]
And still it is available via a direct GET request : http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl Notice that the error code is 502 and not 404. We changed our code as discussed in a previous mail (see below), it seemed to work a little, but now we have this new problem showing... Thanks ! Maud Coordonnées ------------------------------------------------------------------------ /« Ne travaillez jamais »/ Maud Ingarao IHRIM - UMR 5317 Institut d’histoire des représentations et des idées dans les modernités Ecole Normale Supérieure de Lyon - Site Descartes - Bureau R322 15 Parvis René Descartes - BP7000 - 69342 Lyon CEDEX 07 +33 4 37 37 65 79 - maud.ingarao at ens-lyon.fr /Je suis absente le vendredi - Out of office on Fridays/ http://ihrim.ens-lyon.fr/ http://institutdesanti.ens-lyon.fr/ http://ahn.ens-lyon.fr/ Hi Maud, Sorry for the delay, I’ll soon give you an answer on your other e-mails!
Quoted text · 7 lines
> Response : > HTTP ERROR 400 > Problem accessing /synopsx/files/synopsx.js. Reason: > > Stopped at/resource/basex/webapp/synopsx/_restxq/files.xqm, 38/10: > [SEPM0017] Value of 'method' must be one of > (xml,xhtml,html,json,csv,text,adaptive,basex).
With 8.4, the "raw" output method has become obsolete. Your code should work if you remove the following line:
    <output:method value='raw'/>
Here is yet another solution for the synopsx.files:file() function, which is a bit more compact:
   function synopsx.files:file($file as xs:string) as item()+ {
     let $path := $G:FILES || $file
     return (
       web:response-header(map { 'media-type': web:content-type($path) }),
       file:read-binary($path)
     )
   };
Hope this helps, feel free to ask more questions, Christian
MI
Maud Ingarao25 May 2016 17:30 #
PS : and if I open this same URL http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl with oXygen, it opens without any problem and I get the nice green validation light whispering to me my stylesheet's code is okay... Coordonnées ------------------------------------------------------------------------ /« Ne travaillez jamais »/ Maud Ingarao IHRIM - UMR 5317 Institut d’histoire des représentations et des idées dans les modernités Ecole Normale Supérieure de Lyon - Site Descartes - Bureau R322 15 Parvis René Descartes - BP7000 - 69342 Lyon CEDEX 07 +33 4 37 37 65 79 - maud.ingarao at ens-lyon.fr /Je suis absente le vendredi - Out of office on Fridays/ http://ihrim.ens-lyon.fr/ http://institutdesanti.ens-lyon.fr/ http://ahn.ens-lyon.fr/
Quoted text · Maud Ingarao · 100 lines
On 25/05/2016 17:05, Maud Ingarao wrote: > Hello dear friends > > Since we upgraded to 8.3 or 8.4, we have strange behaviours with > static files. > > For example, this file cannot be accessed when called from another xsl > (include or import) as shown in the logs : > [GET] http://rey.huma-num.fr/inventaire/Rey17470124; Stopped at > /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/mappings/htmlWrapping.xqm, > 168/33: [bxerr:BXSL0001] Error on line 7 column 78 of > tei2html-fiche.xsl: XTSE0165: I/O error reported by XML parser > processing http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl: > Server returned HTTP response code: 502 for URL: > http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl Stack Trace: - > /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/mappings/htmlWrapping.xqm, > 78/47 - > /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/models/synopsx.xqm, > 168/49 - > /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/workspace/rey/_restxq/rey.xqm, > 443/43 > > So is it called in the other xsl : > > <?xml version="1.0" encoding="UTF-8"?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version="3.0" > xmlns="http://www.w3.org/1999/xhtml" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > exclude-result-prefixes="xs"> > <xsl:output method="xml" encoding="UTF-8" indent="no" > omit-xml-declaration="yes"/> > <xsl:import > href="http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl"/> > [...] > > And still it is available via a direct GET request : > http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl > > Notice that the error code is 502 and not 404. > > We changed our code as discussed in a previous mail (see below), it > seemed to work a little, but now we have this new problem showing... > > Thanks ! > > Maud > Coordonnées > ------------------------------------------------------------------------ > > > /« Ne travaillez jamais »/ > > > Maud Ingarao > > IHRIM - UMR 5317 > Institut d’histoire des représentations et des idées dans les modernités > Ecole Normale Supérieure de Lyon - Site Descartes - Bureau R322 > 15 Parvis René Descartes - BP7000 - 69342 Lyon CEDEX 07 > +33 4 37 37 65 79 - maud.ingarao at ens-lyon.fr > > /Je suis absente le vendredi - Out of office on Fridays/ > > http://ihrim.ens-lyon.fr/ > http://institutdesanti.ens-lyon.fr/ > http://ahn.ens-lyon.fr/ > > > > Hi Maud, > > Sorry for the delay, I’ll soon give you an answer on your other e-mails! > >> Response : >> HTTP ERROR 400 >> Problem accessing /synopsx/files/synopsx.js. Reason: >> >> Stopped at/resource/basex/webapp/synopsx/_restxq/files.xqm, 38/10: >> [SEPM0017] Value of 'method' must be one of >> (xml,xhtml,html,json,csv,text,adaptive,basex). > With 8.4, the "raw" output method has become obsolete. Your code > should work if you remove the following line: > > <output:method value='raw'/> > > Here is yet another solution for the synopsx.files:file() function, > which is a bit more compact: > > function synopsx.files:file($file as xs:string) as item()+ { > let $path := $G:FILES || $file > return ( > web:response-header(map { 'media-type': web:content-type($path) }), > file:read-binary($path) > ) > }; > > Hope this helps, feel free to ask more questions, > Christian >
CG
Christian Grün25 May 2016 19:23 #
Hi Maud, Do you think you could provide us with the XQuery snippet, or the RESTXQ function, that causes the problem? Thanks in advance! Christian
Quoted text · Maud Ingarao · 124 lines
On Wed, May 25, 2016 at 5:30 PM, Maud Ingarao <maud.ingarao at ens-lyon.fr> wrote: > PS : and if I open this same URL > http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl with oXygen, it opens > without any problem and I get the nice green validation light whispering to > me my stylesheet's code is okay... > > ________________________________ > > > « Ne travaillez jamais » > > Maud Ingarao > > IHRIM - UMR 5317 > Institut d’histoire des représentations et des idées dans les modernités > Ecole Normale Supérieure de Lyon - Site Descartes - Bureau R322 > 15 Parvis René Descartes - BP7000 - 69342 Lyon CEDEX 07 > +33 4 37 37 65 79 - maud.ingarao at ens-lyon.fr > > Je suis absente le vendredi - Out of office on Fridays > > http://ihrim.ens-lyon.fr/ > http://institutdesanti.ens-lyon.fr/ > http://ahn.ens-lyon.fr/ > On 25/05/2016 17:05, Maud Ingarao wrote: > > Hello dear friends > > Since we upgraded to 8.3 or 8.4, we have strange behaviours with static > files. > > For example, this file cannot be accessed when called from another xsl > (include or import) as shown in the logs : > [GET] http://rey.huma-num.fr/inventaire/Rey17470124; Stopped at > /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/mappings/htmlWrapping.xqm, > 168/33: [bxerr:BXSL0001] Error on line 7 column 78 of tei2html-fiche.xsl: > XTSE0165: I/O error reported by XML parser processing > http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl: Server returned HTTP > response code: 502 for URL: > http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl Stack Trace: - > /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/mappings/htmlWrapping.xqm, > 78/47 - > /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/models/synopsx.xqm, > 168/49 - > /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/workspace/rey/_restxq/rey.xqm, > 443/43 > > So is it called in the other xsl : > > <?xml version="1.0" encoding="UTF-8"?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version="3.0" > xmlns="http://www.w3.org/1999/xhtml" > xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"> > <xsl:output method="xml" encoding="UTF-8" indent="no" > omit-xml-declaration="yes"/> > <xsl:import href="http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl"/> > [...] > > And still it is available via a direct GET request : > http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl > > Notice that the error code is 502 and not 404. > > We changed our code as discussed in a previous mail (see below), it seemed > to work a little, but now we have this new problem showing... > > Thanks ! > > Maud > ________________________________ > > > « Ne travaillez jamais » > > Maud Ingarao > > IHRIM - UMR 5317 > Institut d’histoire des représentations et des idées dans les modernités > Ecole Normale Supérieure de Lyon - Site Descartes - Bureau R322 > 15 Parvis René Descartes - BP7000 - 69342 Lyon CEDEX 07 > +33 4 37 37 65 79 - maud.ingarao at ens-lyon.fr > > Je suis absente le vendredi - Out of office on Fridays > > http://ihrim.ens-lyon.fr/ > http://institutdesanti.ens-lyon.fr/ > http://ahn.ens-lyon.fr/ > > > > Hi Maud, > > Sorry for the delay, I’ll soon give you an answer on your other e-mails! > > Response : > HTTP ERROR 400 > Problem accessing /synopsx/files/synopsx.js. Reason: > > Stopped at /resource/basex/webapp/synopsx/_restxq/files.xqm, 38/10: > [SEPM0017] Value of 'method' must be one of > (xml,xhtml,html,json,csv,text,adaptive,basex). > > With 8.4, the "raw" output method has become obsolete. Your code > should work if you remove the following line: > > <output:method value='raw'/> > > Here is yet another solution for the synopsx.files:file() function, > which is a bit more compact: > > function synopsx.files:file($file as xs:string) as item()+ { > let $path := $G:FILES || $file > return ( > web:response-header(map { 'media-type': web:content-type($path) }), > file:read-binary($path) > ) > }; > > Hope this helps, feel free to ask more questions, > Christian > > >
MI
Maud Ingarao30 May 2016 10:35 #
Hi dear friends The function calling the xsl is below, but I think it is important to say it is this function had been working for monthes on this website without problems. We were not working on this website at the time and were not modifying the restxq code at all. All we did was upgrading to 8.4, that caused the problem due to the deprecated function which I patched according to your advise Christian. Then it seemed to work a little... And now we have this 502 bad gateway error. More generally, we have the feeling that BaseX works without problems in "simple" environments (localhost, servers without proxies...), but that we enconter lots of troubles as soon as proxies come into play (see our recurrent webdav problems through oXygen on huma-num servers which use lots of proxies...). Unfortunatly we have no idea of what we could change and at which level to avoid it... Do other users use BaseX in environements with proxies and have it work fine ? All the best ! Maud
declare function render($queryParams as map(*), $outputParams as map(*),
$value as node()* ) as item()* {
   let $xquery := map:get($outputParams, 'xquery')
   let $xsl :=  map:get($outputParams, 'xsl')
   let $options := map{
     'lb' : map:get($outputParams, 'lb')
     }
   return
     if ($xquery)
       then synopsx.mappings.tei2html:entry($value, $options)
     else if ($xsl)
       then for $node in $value
    return xslt:transform($node,
synopsx.models.synopsx:getXsltPath($queryParams, $xsl))
       else $value
};
In this case it calls an xsl which imports another xsl. This import inside the xsl seems to cause the 502 error... Again this worked perfectly before upgrading to 8.4 (We were in 8.1 ou 8.2 I think)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="3.0"
   xpath-default-namespace="http://www.tei-c.org/ns/1.0"
xmlns="http://www.w3.org/1999/xhtml"
   xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs">
   <xsl:output method="xml" encoding="UTF-8" indent="no"
omit-xml-declaration="yes"/>
<xsl:import href="http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl"/>
   <xsl:template match="/">
     <xsl:apply-templates/>
   </xsl:template>
   <xsl:template match="*:head | *:title">
     <h1>
       <span>
         <xsl:apply-templates/>
       </span>
     </h1>
   </xsl:template>
   <xsl:template match="*:p">
     <p>
       <xsl:apply-templates/>
     </p>
   </xsl:template>
   <xsl:template match="*:p[@n = 'more']">
     <p class="more">
       <xsl:apply-templates/>
     </p>
     <a class="linkPlus">Lire la suite</a>
   </xsl:template>
</xsl:stylesheet>
Coordonnées ------------------------------------------------------------------------ /« Ne travaillez jamais »/ Maud Ingarao IHRIM - UMR 5317 Institut d’histoire des représentations et des idées dans les modernités Ecole Normale Supérieure de Lyon - Site Descartes - Bureau R322 15 Parvis René Descartes - BP7000 - 69342 Lyon CEDEX 07 +33 4 37 37 65 79 - maud.ingarao at ens-lyon.fr /Je suis absente le vendredi - Out of office on Fridays/ http://ihrim.ens-lyon.fr/ http://institutdesanti.ens-lyon.fr/ http://ahn.ens-lyon.fr/
Quoted text · Christian Grün · 134 lines
On 25/05/2016 19:23, Christian Grün wrote: > Hi Maud, > > Do you think you could provide us with the XQuery snippet, or the > RESTXQ function, that causes the problem? > > Thanks in advance! > Christian > > > On Wed, May 25, 2016 at 5:30 PM, Maud Ingarao <maud.ingarao at ens-lyon.fr> wrote: >> PS : and if I open this same URL >> http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl with oXygen, it opens >> without any problem and I get the nice green validation light whispering to >> me my stylesheet's code is okay... >> >> ________________________________ >> >> >> « Ne travaillez jamais » >> >> Maud Ingarao >> >> IHRIM - UMR 5317 >> Institut d’histoire des représentations et des idées dans les modernités >> Ecole Normale Supérieure de Lyon - Site Descartes - Bureau R322 >> 15 Parvis René Descartes - BP7000 - 69342 Lyon CEDEX 07 >> +33 4 37 37 65 79 - maud.ingarao at ens-lyon.fr >> >> Je suis absente le vendredi - Out of office on Fridays >> >> http://ihrim.ens-lyon.fr/ >> http://institutdesanti.ens-lyon.fr/ >> http://ahn.ens-lyon.fr/ >> On 25/05/2016 17:05, Maud Ingarao wrote: >> >> Hello dear friends >> >> Since we upgraded to 8.3 or 8.4, we have strange behaviours with static >> files. >> >> For example, this file cannot be accessed when called from another xsl >> (include or import) as shown in the logs : >> [GET] http://rey.huma-num.fr/inventaire/Rey17470124; Stopped at >> /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/mappings/htmlWrapping.xqm, >> 168/33: [bxerr:BXSL0001] Error on line 7 column 78 of tei2html-fiche.xsl: >> XTSE0165: I/O error reported by XML parser processing >> http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl: Server returned HTTP >> response code: 502 for URL: >> http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl Stack Trace: - >> /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/mappings/htmlWrapping.xqm, >> 78/47 - >> /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/models/synopsx.xqm, >> 168/49 - >> /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/workspace/rey/_restxq/rey.xqm, >> 443/43 >> >> So is it called in the other xsl : >> >> <?xml version="1.0" encoding="UTF-8"?> >> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >> version="3.0" >> xmlns="http://www.w3.org/1999/xhtml" >> xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"> >> <xsl:output method="xml" encoding="UTF-8" indent="no" >> omit-xml-declaration="yes"/> >> <xsl:import href="http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl"/> >> [...] >> >> And still it is available via a direct GET request : >> http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl >> >> Notice that the error code is 502 and not 404. >> >> We changed our code as discussed in a previous mail (see below), it seemed >> to work a little, but now we have this new problem showing... >> >> Thanks ! >> >> Maud >> ________________________________ >> >> >> « Ne travaillez jamais » >> >> Maud Ingarao >> >> IHRIM - UMR 5317 >> Institut d’histoire des représentations et des idées dans les modernités >> Ecole Normale Supérieure de Lyon - Site Descartes - Bureau R322 >> 15 Parvis René Descartes - BP7000 - 69342 Lyon CEDEX 07 >> +33 4 37 37 65 79 - maud.ingarao at ens-lyon.fr >> >> Je suis absente le vendredi - Out of office on Fridays >> >> http://ihrim.ens-lyon.fr/ >> http://institutdesanti.ens-lyon.fr/ >> http://ahn.ens-lyon.fr/ >> >> >> >> Hi Maud, >> >> Sorry for the delay, I’ll soon give you an answer on your other e-mails! >> >> Response : >> HTTP ERROR 400 >> Problem accessing /synopsx/files/synopsx.js. Reason: >> >> Stopped at /resource/basex/webapp/synopsx/_restxq/files.xqm, 38/10: >> [SEPM0017] Value of 'method' must be one of >> (xml,xhtml,html,json,csv,text,adaptive,basex). >> >> With 8.4, the "raw" output method has become obsolete. Your code >> should work if you remove the following line: >> >> <output:method value='raw'/> >> >> Here is yet another solution for the synopsx.files:file() function, >> which is a bit more compact: >> >> function synopsx.files:file($file as xs:string) as item()+ { >> let $path := $G:FILES || $file >> return ( >> web:response-header(map { 'media-type': web:content-type($path) }), >> file:read-binary($path) >> ) >> }; >> >> Hope this helps, feel free to ask more questions, >> Christian >> >> >>
MI
Maud Ingarao30 May 2016 11:04 #
PS : I forgot to mention a very interesting and very strange thing : When the xquery render() function below calls http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl directly, it works perfectly. It is only when called from another xsl (itself lying in the static/ directory) that we get this I/O 502 error : [GET] http://rey.huma-num.fr/home; Stopped at /sites/papiersmmrey/resource/basex/webapp/synopsx/mappings/htmlWrapping.xqm, 168/33: [bxerr:BXSL0001] Error on line 7 column 77 of tei2html.xsl: XTSE0165: I/O error reported by XML parser processing http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl: Server returned HTTP response code: 502 for URL: http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl Stack Trace: - /sites/papiersmmrey/resource/basex/webapp/synopsx/models/synopsx.xqm, 168/49 - /sites/papiersmmrey/resource/basex/webapp/synopsx/workspace/rey/_restxq/rey.xqm, 90/43 Coordonnées ------------------------------------------------------------------------ /« Ne travaillez jamais »/ Maud Ingarao IHRIM - UMR 5317 Institut d’histoire des représentations et des idées dans les modernités Ecole Normale Supérieure de Lyon - Site Descartes - Bureau R322 15 Parvis René Descartes - BP7000 - 69342 Lyon CEDEX 07 +33 4 37 37 65 79 - maud.ingarao at ens-lyon.fr /Je suis absente le vendredi - Out of office on Fridays/ http://ihrim.ens-lyon.fr/ http://institutdesanti.ens-lyon.fr/ http://ahn.ens-lyon.fr/
Quoted text · Maud Ingarao · 249 lines
On 30/05/2016 10:35, Maud Ingarao wrote: > Hi dear friends > > The function calling the xsl is below, but I think it is important to > say it is this function had been working for monthes on this website > without problems. > > We were not working on this website at the time and were not modifying > the restxq code at all. > All we did was upgrading to 8.4, that caused the problem due to the > deprecated function which I patched according to your advise Christian. > > Then it seemed to work a little... And now we have this 502 bad > gateway error. > > More generally, we have the feeling that BaseX works without problems > in "simple" environments (localhost, servers without proxies...), but > that we enconter lots of troubles as soon as proxies come into play > (see our recurrent webdav problems through oXygen on huma-num servers > which use lots of proxies...). > > Unfortunatly we have no idea of what we could change and at which > level to avoid it... > > Do other users use BaseX in environements with proxies and have it > work fine ? > > All the best ! > > Maud > > > declare function render($queryParams as map(*), $outputParams as > map(*), $value as node()* ) as item()* { > let $xquery := map:get($outputParams, 'xquery') > let $xsl := map:get($outputParams, 'xsl') > let $options := map{ > 'lb' : map:get($outputParams, 'lb') > } > return > if ($xquery) > then synopsx.mappings.tei2html:entry($value, $options) > else if ($xsl) > then for $node in $value > return xslt:transform($node, > synopsx.models.synopsx:getXsltPath($queryParams, $xsl)) > else $value > }; > > In this case it calls an xsl which imports another xsl. This import > inside the xsl seems to cause the 502 error... > Again this worked perfectly before upgrading to 8.4 > (We were in 8.1 ou 8.2 I think) > > > <?xml version="1.0" encoding="UTF-8"?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version="3.0" > xpath-default-namespace="http://www.tei-c.org/ns/1.0" > xmlns="http://www.w3.org/1999/xhtml" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > exclude-result-prefixes="xs"> > <xsl:output method="xml" encoding="UTF-8" indent="no" > omit-xml-declaration="yes"/> > <xsl:import href="http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl"/> > <xsl:template match="/"> > <xsl:apply-templates/> > </xsl:template> > <xsl:template match="*:head | *:title"> > <h1> > <span> > <xsl:apply-templates/> > </span> > </h1> > </xsl:template> > <xsl:template match="*:p"> > <p> > <xsl:apply-templates/> > </p> > </xsl:template> > <xsl:template match="*:p[@n = 'more']"> > <p class="more"> > <xsl:apply-templates/> > </p> > <a class="linkPlus">Lire la suite</a> > </xsl:template> > </xsl:stylesheet> > > > > > > > Coordonnées > ------------------------------------------------------------------------ > > > /« Ne travaillez jamais »/ > > > Maud Ingarao > > IHRIM - UMR 5317 > Institut d’histoire des représentations et des idées dans les modernités > Ecole Normale Supérieure de Lyon - Site Descartes - Bureau R322 > 15 Parvis René Descartes - BP7000 - 69342 Lyon CEDEX 07 > +33 4 37 37 65 79 - maud.ingarao at ens-lyon.fr > > /Je suis absente le vendredi - Out of office on Fridays/ > > http://ihrim.ens-lyon.fr/ > http://institutdesanti.ens-lyon.fr/ > http://ahn.ens-lyon.fr/ > > On 25/05/2016 19:23, Christian Grün wrote: >> Hi Maud, >> >> Do you think you could provide us with the XQuery snippet, or the >> RESTXQ function, that causes the problem? >> >> Thanks in advance! >> Christian >> >> >> On Wed, May 25, 2016 at 5:30 PM, Maud Ingarao<maud.ingarao at ens-lyon.fr> wrote: >>> PS : and if I open this same URL >>> http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl with oXygen, it opens >>> without any problem and I get the nice green validation light whispering to >>> me my stylesheet's code is okay... >>> >>> ________________________________ >>> >>> >>> « Ne travaillez jamais » >>> >>> Maud Ingarao >>> >>> IHRIM - UMR 5317 >>> Institut d’histoire des représentations et des idées dans les modernités >>> Ecole Normale Supérieure de Lyon - Site Descartes - Bureau R322 >>> 15 Parvis René Descartes - BP7000 - 69342 Lyon CEDEX 07 >>> +33 4 37 37 65 79 -maud.ingarao at ens-lyon.fr >>> >>> Je suis absente le vendredi - Out of office on Fridays >>> >>> http://ihrim.ens-lyon.fr/ >>> http://institutdesanti.ens-lyon.fr/ >>> http://ahn.ens-lyon.fr/ >>> On 25/05/2016 17:05, Maud Ingarao wrote: >>> >>> Hello dear friends >>> >>> Since we upgraded to 8.3 or 8.4, we have strange behaviours with static >>> files. >>> >>> For example, this file cannot be accessed when called from another xsl >>> (include or import) as shown in the logs : >>> [GET]http://rey.huma-num.fr/inventaire/Rey17470124; Stopped at >>> /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/mappings/htmlWrapping.xqm, >>> 168/33: [bxerr:BXSL0001] Error on line 7 column 78 of tei2html-fiche.xsl: >>> XTSE0165: I/O error reported by XML parser processing >>> http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl: Server returned HTTP >>> response code: 502 for URL: >>> http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl Stack Trace: - >>> /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/mappings/htmlWrapping.xqm, >>> 78/47 - >>> /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/models/synopsx.xqm, >>> 168/49 - >>> /sites/papiersmmrey/resource/basex/basex.8.4.3/webapp/synopsx/workspace/rey/_restxq/rey.xqm, >>> 443/43 >>> >>> So is it called in the other xsl : >>> >>> <?xml version="1.0" encoding="UTF-8"?> >>> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >>> version="3.0" >>> xmlns="http://www.w3.org/1999/xhtml" >>> xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"> >>> <xsl:output method="xml" encoding="UTF-8" indent="no" >>> omit-xml-declaration="yes"/> >>> <xsl:import href="http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl"/> >>> [...] >>> >>> And still it is available via a direct GET request : >>> http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl >>> >>> Notice that the error code is 502 and not 404. >>> >>> We changed our code as discussed in a previous mail (see below), it seemed >>> to work a little, but now we have this new problem showing... >>> >>> Thanks ! >>> >>> Maud >>> ________________________________ >>> >>> >>> « Ne travaillez jamais » >>> >>> Maud Ingarao >>> >>> IHRIM - UMR 5317 >>> Institut d’histoire des représentations et des idées dans les modernités >>> Ecole Normale Supérieure de Lyon - Site Descartes - Bureau R322 >>> 15 Parvis René Descartes - BP7000 - 69342 Lyon CEDEX 07 >>> +33 4 37 37 65 79 -maud.ingarao at ens-lyon.fr >>> >>> Je suis absente le vendredi - Out of office on Fridays >>> >>> http://ihrim.ens-lyon.fr/ >>> http://institutdesanti.ens-lyon.fr/ >>> http://ahn.ens-lyon.fr/ >>> >>> >>> >>> Hi Maud, >>> >>> Sorry for the delay, I’ll soon give you an answer on your other e-mails! >>> >>> Response : >>> HTTP ERROR 400 >>> Problem accessing /synopsx/files/synopsx.js. Reason: >>> >>> Stopped at /resource/basex/webapp/synopsx/_restxq/files.xqm, 38/10: >>> [SEPM0017] Value of 'method' must be one of >>> (xml,xhtml,html,json,csv,text,adaptive,basex). >>> >>> With 8.4, the "raw" output method has become obsolete. Your code >>> should work if you remove the following line: >>> >>> <output:method value='raw'/> >>> >>> Here is yet another solution for the synopsx.files:file() function, >>> which is a bit more compact: >>> >>> function synopsx.files:file($file as xs:string) as item()+ { >>> let $path := $G:FILES || $file >>> return ( >>> web:response-header(map { 'media-type': web:content-type($path) }), >>> file:read-binary($path) >>> ) >>> }; >>> >>> Hope this helps, feel free to ask more questions, >>> Christian >>> >>> >>> >
CG
Christian Grün31 May 2016 12:19 #
Hi Maud, 502 means that the server returned an invalid answer. It could be that the relative paths cannot be correctly resolved (but I’m not sure why it seemed to work with previous versions of BaseX). Have you moved some of the files? I’ll be happy to have a look at the files in question; could you send them to me? Merci d'avance, Christian
Quoted text · Maud Ingarao · 19 lines
On Mon, May 30, 2016 at 11:04 AM, Maud Ingarao <maud.ingarao at ens-lyon.fr> wrote: > PS : I forgot to mention a very interesting and very strange thing : > > When the xquery render() function below calls > http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl directly, it works > perfectly. > It is only when called from another xsl (itself lying in the static/ > directory) that we get this I/O 502 error : > [GET] http://rey.huma-num.fr/home; Stopped at > /sites/papiersmmrey/resource/basex/webapp/synopsx/mappings/htmlWrapping.xqm, > 168/33: [bxerr:BXSL0001] Error on line 7 column 77 of tei2html.xsl: > XTSE0165: I/O error reported by XML parser processing > http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl: Server returned HTTP > response code: 502 for URL: > http://rey.huma-num.fr/synopsx/files/xsl/tei2html.xsl Stack Trace: - > /sites/papiersmmrey/resource/basex/webapp/synopsx/models/synopsx.xqm, 168/49 > - > /sites/papiersmmrey/resource/basex/webapp/synopsx/workspace/rey/_restxq/rey.xqm, > 90/43

⚡Generated with XQuery