Mike,

Do you have any news on this bug ?

Xmlizer


2013/9/5 David Rudel <fwqhgads@gmail.com>
Thanks, Michael.

This probably won't surprise you, but the actual node being processed in the template was the expected node. In other words if I did a <xsl:copy-of select="."/>, I would get the node from the document I expected to get. It is just that when I called base-uri(.) I get the uri for a different one.


-David





On Wed, Sep 4, 2013 at 9:47 PM, Michael Kay <mike@saxonica.com> wrote:
Thanks, we'll look into this.

My suspicion would be that this is a concurrency effect. In 9.5 we made the collection() function multi-threaded, so it can be parsing several documents in parallel in different threads.

Michael Kay
Saxonica

On 4 Sep 2013, at 18:58, David Rudel wrote:

> Hi all,
> My understanding is that if base-uri(.) is called when the context node is part of a raw XML file, then it should return the URI of the document containing the context node.
>
> When using the collection() function, I am finding examples where base-uri(.) called when focus is on a node in one document evaluates to the URI of a different document in the collection.
>
> Here is a test setup:
>
> I have a folder with URI = $URI
> THis folder has lots of raw XML files of the form:
> <pedagogicalTrace>
> <student>
> .....
> </student>
> .....
> </pedagogicalTrace>
>
>
> To test the URIs, I process this with the following code. The first template is the initial template.
>
> <xsl:template name="main">
> <xsl:variable name="URI" select ="[foldername]" />
> <xsl:for-each
>                                 select="collection(concat($URI,'?select=*_[0-9]+.xml;recurse=yes;on-error=ignore'))">
>                                 <xsl:text>
>     </xsl:text><xsl:value-of select="base-uri(.)"/>
>                                 <xsl:text>
>     </xsl:text>
>                                 <xsl:apply-templates select="pedagogicalTrace/student"/>
>
>                             </xsl:for-each>
> </xsl:template>
>
>     <xsl:template match="student">
>         <xsl:value-of select="base-uri(.)"/>
>     </xsl:template>
>
> When I run the above, the URIs printed out in the Main template appear correct, but the URIs printed out when base-uri(.) is applied to the student node inside the document are sometimes correct and sometimes wrong. Sometimes the evaluate to the URI of a different file in the collection.
>
> --
>
> "A false conclusion, once arrived at and widely accepted is not dislodged easily, and the less it is understood, the more tenaciously it is held." - Cantor's Law of Preservation of Ignorance.
> ------------------------------------------------------------------------------
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk_______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> saxon-help@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help



--

"A false conclusion, once arrived at and widely accepted is not dislodged easily, and the less it is understood, the more tenaciously it is held." - Cantor's Law of Preservation of Ignorance.

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help