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

[xsl] RE: result document flush

Subject: [xsl] RE: result document flush
From: Robby Pelssers <Robby.Pelssers@xxxxxxx>
Date: Wed, 18 Jul 2012 00:48:48 +0200

Hi all,

I am running into the same issue as described in this thread:

However I can't use the old school grouping technique unfortunately as the
elements don't have the same grouping key.

Already tried to work around it naively by using a function that would
retrieve the key, which didn't seem to work but is that because it just is not
allowed to use a function call in the group-by or because I made a mistake in
my select statement.

@FILENAME))/maximo:*/maximo:*/maximo:*" group-by="znapz:getURI(.)">
    <xsl:apply-templates select="current-group()[1]"/>

Bottom line is,

The other approach described by Abel in the above thread mentions
deduplicating a list of writeable URI's.  How could I incorporate this in
below code?

    <xsl:variable name="uniqueURIs" select="distinct-values(for $element in
document(concat($sourceFolder, @FILENAME))/maximo:*/maximo:*/maximo:* return

    <xsl:template match="/">

    <xsl:template match="PACKAGEFILE">
        <xsl:apply-templates  select="document(concat($sourceFolder,

    <xsl:function name="znapz:getURI" as="xs:anyURI">
        <xsl:param name="element" as="element()"/>
        <xsl:apply-templates select="$element" mode="getURI"/>

    <xsl:template match="maximo:*">
     <!-somehow I would need to  use that sequence of uniqueURI's here but I
can't e.g. remove used ones for checking later on again --?>
        <xsl:result-document method="xml" href="{znapz:getURI(.)}">
            <xsl:element xmlns="http://www.ibm.com/maximo"
                <xsl:apply-templates select="../../@*"/>
                <xsl:element name="{../local-name()}">
                    <xsl:copy-of select="."/>

Kind regards,

Current Thread