I believe you should be able to do something like the following to get what
you want:
<xsl:template match="//db:informalfigure[descendant::db:imagedata and
@role='figure']">
<xsl:variable name="curImage" select=
"substring-after(.//@fileref,'/')"/>
<xsl:variable name="id" select=
"$imageMetaData//image[name=string-join(($curISBN,$curImage),'/')]/id"/>
<xsl:if test="not(doc-available(
xdmp:resolve-uri(string-join(('out/',$id,'.xml'),''),xdmp:node-uri(.))))">
<!--This check fails, am I doing it incorrectly or is it the way xslt
processes document that makes it hard to check if the id have been
encountered before?-->
<xsl:result-document method="xml" href="out/{$id}.xml" indent=
"yes">
On Mon, Jul 28, 2014 at 9:08 AM, Mary Holstege <[email protected]>
wrote:
>
> I think you may be running afoul of URI resolution.
> Since the URI you are giving to doc-available is a relative
> URI, it will be resolved relative to the static base URI, which
> per XSLT is the URI of the stylesheet itself.
>
> //Mary
>
> On Mon, 28 Jul 2014 07:58:04 -0700, Erik Zander
> <[email protected]> wrote:
>
> > Hi All
> >
> > I’m working on an xslt transform where I’m extracting data about images
> > from a document and put
> > that data into result document, It all works fine except for when the
> > same image occurs more than once as I then get conflicting uris,
> >
> > my code looks like this
> > <xsl:template match="//db:informalfigure[descendant::db:imagedata and
> > @role='figure']">
> >
> >
> >
> > <xsl:variable name="curImage"
> > select="substring-after(.//@fileref,'/')"/>
> >
> > <xsl:variable name="id"
> >
> select="$imageMetaData//image[name=string-join(($curISBN,$curImage),'/')]/id"/>
> > <xsl:if
> > test="not(doc-available(string-join(('out/',$id,'.xml'),'')))">
> > <!--This check fails, am I doing it incorrectly or is it the way xslt
> > processes document that makes it hard to check if the id have been
> > encountered before?-->
> >
> > <xsl:result-document method="xml" href="out/{$id}.xml"
> > indent="yes">
> >
> > Ideally I would like to be able to check if the result document have
> > been created or not and after that decide if I want to update it with
> > more information or just leave it be.
> >
> > Would appreciate any help on the subject
> >
> > Best regards
> > Erik
>
>
> --
> 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