[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Keeping result-document() from writing to a file m

Subject: Re: Keeping result-document() from writing to a file more than once?
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 Apr 2019 15:10:45 -0000
Re:  Keeping result-document() from writing to a file m
On 19.04.2019 17:02, Eliot Kimber ekimber@xxxxxxxxxxxx wrote:

If you construct map entries for each use and then combine them into a
single map using the "use-first" or "use-any" "duplicates" option then you can
blindly process all the references and let the map-merge process produce a
single list of elements, e.g.;

<xsl:variable name="use-entries" as="map(*)*"> <xsl:call-template name="find-all-conrefs"/> </xsl:variable>

The find-all-conrefs template generates maps, one for each id/element pair,
which you can create with xsl:map or using the literal map constructor:
"map{$key : $value}".

Now make a single map:


<xsl:variable name="use-map" as="map(*)"
   select="map:merge($use-entries, map{ 'duplicates' : 'use-any'}"
/>

And then process the entries to produce the result docs:

<xsl:for-each select="map:keys($use-map)">
   <xsl:variable name="key" select="." as="xs:string"/>
   <xsl:call-template name="make-result-doc">
     <xsl:with-param name="key" as="xs:string" select="$key"/>
     <xsl:with-param name="key" as="element() " select="map:get($use-map,
$key)" as="element() "/>

Isn't that second parameter supposed to be named
       <xsl:with-param name="value" as="element() "
select="map:get($use-map, $key)" as="element() "/>
?

   </xsl:call-template>
</xsl:for-each>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.