You can use the xdmp:resolve-uri function from xslt to get this behavior:

http://docs.marklogic.com/xdmp:resolve-uri

It has more lax semantics than the fn:resolve-uri.

I think that should solve the issue here.

-Danny

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Mary Holstege
Sent: Friday, December 07, 2012 8:02 AM
To: MarkLogic Developer Discussion; Mike Sokolov
Subject: Re: [MarkLogic Dev General] resolve-uri working differently in XQuery 
and XSLT?

On Fri, 07 Dec 2012 07:48:53 -0800, Mike Sokolov <[email protected]>
wrote:

> I think that could be because it's not well-defined how to interpret a 
> URI if you don't know what the scheme is?  IE: is it possible that 
> path resolution depends on the scheme?  Just a guess, I haven't read 
> the relevant standard...
>
> -Mike

What it is is that XSLT and XQuery 1.0 (strict) both run in standards compliant 
mode, which claim you can't resolve against a relative URI, whereas, for 
compatibility reasons and because in the context of MarkLogic where DB URIs 
tend to be relative, it is awkard otherwise, 1.0-ml and 0.9-ml allow for the 
relative resolution.

We have an RFE to allow folks to turn on this extension in XSLT as well.

//Mary

>
> On 12/07/2012 10:08 AM, Geert Josten wrote:
>> I temporarily resorted to prepending 'file:/', and doing a 
>> substring-after once resolved. They really are relative uri's, and 
>> need to stay that way.
>>
>> Odd that that isn't standard compliant. It is very useful to my 
>> opinion..
>>
>> Grtz
>>
>>
>>> -----Oorspronkelijk bericht-----
>>> Van: [email protected] [mailto:general- 
>>> [email protected]] Namens Jakob Fix
>>> Verzonden: vrijdag 7 december 2012 15:39
>>> Aan: MarkLogic Developer Discussion
>>> Onderwerp: Re: [MarkLogic Dev General] resolve-uri working 
>>> differently
>>>
>> in
>>
>>> XQuery and XSLT?
>>>
>>> Hi Geert,
>>>
>>> any chance your problem is related to a recent change in ML 6 that 
>>> introduced a documented incompatibility of that function, but made 
>>> it standards-compliant? I came across it while migrating a site ...
>>>
>>> https://docs.marklogic.com/guide/relnotes/chap4#id_21544
>>>
>>> cheers,
>>> Jakob.
>>>
>>>
>>> On Fri, Dec 7, 2012 at 2:37 PM, Geert Josten<[email protected]>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I was a bit surprised by the fact that this works:
>>>>
>>>>          resolve-uri('high-tide.jpg', '/foo/bar.xml')
>>>>
>>>> But this doesn't..
>>>>
>>>>          xdmp:xslt-eval(<xsl:stylesheet version="2.0"
>>>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>>>>          <xsl:template match="node()">
>>>>                  <test>
>>>>                  <xsl:value-of select="resolve-uri('my.jpg', 
>>>> '/foo/bar.xml')"/>
>>>>                  </test>
>>>>          </xsl:template>
>>>>          </xsl:stylesheet>,<test/>)
>>>>
>>>> Anyone know a trick to get the same behavior in XSLT?
>>>>
>>>> Kind regards,
>>>> Geert
>>>>
>>>> M.Sc. G.P.H. (Geert) Josten
>>>> Senior Developer
>>>>
>>>>
>>>> Dayon B.V.
>>>> Delftechpark 37b
>>>> 2628 XJ Delft
>>>> The Netherlands
>>>>
>>>> T +31 (0)88 26 82 570
>>>>
>>>> [email protected]
>>>> www.dayon.nl
>>>>
>>>> De informatie - verzonden in of met dit e-mailbericht - is 
>>>> afkomstig
>>>>
>> van
>>
>>>> Dayon BV en is uitsluitend bestemd voor de geadresseerde. Indien u 
>>>> dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen.
>>>>
>>> Aan
>>>
>>>> dit bericht kunnen geen rechten worden ontleend.
>>>> _______________________________________________
>>>> General mailing list
>>>> [email protected]
>>>> http://developer.marklogic.com/mailman/listinfo/general
>>>>
>>> _______________________________________________
>>> General mailing list
>>> [email protected]
>>> http://developer.marklogic.com/mailman/listinfo/general
>>>
>> _______________________________________________
>> General mailing list
>> [email protected]
>> http://developer.marklogic.com/mailman/listinfo/general
>>
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general


--
Using Opera's revolutionary email client: http://www.opera.com/mail/ 
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to