[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

follow-up: document function issue - relative URIs


Subject: follow-up: document function issue - relative URIs
From: <christof.hoeke@xxxxxxx>
Date: Tue, 8 Jun 2004 09:53:41 +0200

hi,

> Remember that document(.) interprets the URI relative to the source
> document, while document(string(.)) interprets it relative to the
> stylesheet.

what is actually the difference between "the source document" and the "stylesheet"? 

should an xslt processor (also 1.0 processors like Xalan or Saxon 6.x) resolve the URI parameter of a document function call - e.g. document('somedir/somefile.xml') - normally relative to the stylesheet in which the call is in? 

i ask because i noted that e.g. Pyana (Python wrapper for Xalan-C) does seem to resolve a document call relative to the Python module that actually does the transformation, or more precisely relative to the main program module (which may import the transformation module).
some other server products (e.g an ATG-Server) seem to handle it different again.

is there any reliable or better said theoretically correct way of interpreting a relative URI? with theoretically correct i mean how it should be for most processors/configurations or even better as stated said in the xslt specification (does it say anything about it?).


hope my question makes sense...
thanks
chris


> -----Ursprüngliche Nachricht-----
> Von: Michael Kay [mailto:mhk@xxxxxxxxx]
> Gesendet: Dienstag, 8. Juni 2004 09:40
> An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Betreff: RE: [xsl] document function issue...
> 
> 
> It would be useful to see your source document, and the 
> actual error message
> rather than a paraphrase of it. It's also relevant to know 
> how you invoked
> the transformation (because the base URIs of source document 
> and stylesheet
> depend on this).
> 
> Remember that document(.) interprets the URI relative to the source
> document, while document(string(.)) interprets it relative to the
> stylesheet.
> 
> Michael Kay 
> 
> > -----Original Message-----
> > From: Markus Gamperl [mailto:markus.gamperl@xxxxxx] 
> > Sent: 08 June 2004 07:13
> > To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> > Subject: [xsl] document function issue...
> > 
> > Hello!
> > 
> > I'm still trying and trying to get the document function 
> > running with Saxon
> > 7.9.1
> > I have opened a lot of threads in other lists and forums but the
> > informations is unhelpfully...
> > 
> > The following template:
> > 
> > <xsl:template match="url">
> >    <xsl:copy-of select="document(.)/page/*"/>
> > </xsl:template>
> > 
> > The URL has the following relative path value: 
> > ./dir1/dir2/dir3/file.xml
> > 
> > The document function in the template above throws and 
> > invalid URI error.
> > But the following works well:
> > <xsl:copy-of select="document('./dir1/dir2/dir3/file.xml')/page/*"/>
> > 
> > So i tried to circumvent Saxon and tried the following (also 
> > not working):
> > <xsl:copy-of select="document(string(.))/page/*"/>
> > or
> > <xsl:variable name="help" select="."/>
> > <xsl:copy-of select="document(concat('''',&help,''''))/page/*"/>
> > 
> > Has anybody an idea what else i could try?
> > 
> > Thanks very much!
> > Markus
> > 
> > -- 
> > +++ Jetzt WLAN-Router f|r alle DSL-Einsteiger und Wechsler +++
> > GMX DSL-Powertarife zudem 3 Monate gratis* http://www.gmx.net/dsl
> > 
> > 
> > 
> --+------------------------------------------------------------------
> > XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> > To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> > or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> > --+--
> > 
> > 
> 
> 
> 
> --+------------------------------------------------------------------
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> --+--
> 
> 


Current Thread
Keywords