This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29505 - [FO31] Section https://www.w3.org/TR/xpath-functions-31/#func-map-for-each defines function named map:for-each but example used function named map:for-each-entry
Summary: [FO31] Section https://www.w3.org/TR/xpath-functions-31/#func-map-for-each de...
Status: CLOSED DUPLICATE of bug 29269
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-25 11:43 UTC by Martin Honnen
Modified: 2016-03-22 09:28 UTC (History)
0 users

See Also:


Attachments

Description Martin Honnen 2016-02-25 11:43:16 UTC
The section https://www.w3.org/TR/xpath-functions-31/#func-map-for-each defines the function "map:for-each" and then gives the example

------------ sample code ----------------------

   <xsl:variable name="dimensions" 
                 select="map{'height': 3, 'width': 4, 'depth': 5}"/>
   
   <xsl:function name="f:make-attribute" as="attribute()">
     <xsl:param name="key" as="xs:string"/>
     <xsl:param name="value" as="xs:anyAtomicType"/>
     <xsl:attribute name="{$key}" select="string($value)"/>
   </xsl:function>
   
   <xsl:template name="convert">
     <box>
       <xsl:sequence select="map:for-each-entry(
                               $dimensions, f:make-attribute#2)"/>
     </box>
   </xsl:template>  

----------- end of sample code ----------------

which uses a function named "map:for-each-entry" instead of "map:for-each".

So the sample should be

------------ sample code ----------------------

   <xsl:variable name="dimensions" 
                 select="map{'height': 3, 'width': 4, 'depth': 5}"/>
   
   <xsl:function name="f:make-attribute" as="attribute()">
     <xsl:param name="key" as="xs:string"/>
     <xsl:param name="value" as="xs:anyAtomicType"/>
     <xsl:attribute name="{$key}" select="string($value)"/>
   </xsl:function>
   
   <xsl:template name="convert">
     <box>
       <xsl:sequence select="map:for-each(
                               $dimensions, f:make-attribute#2)"/>
     </box>
   </xsl:template>  

----------- end of sample code ----------------
Comment 1 Michael Kay 2016-02-25 12:02:47 UTC
Thanks for reporting it. This is a duplicate of bug #29269.

*** This bug has been marked as a duplicate of bug 29269 ***