Home
Über mich
Veröffentlichungen

XML XML-Schema XPath XSL-T XSL-FO XQuery XProc SVG

XPath / XPath-Funktionen / XPath: Sequenz-Funktionen / XPath 3.1: Map, xsl:map / XPath: map:put

XPath: map:put

XPath: map:put

map:put generiert eine Map, die alle Inhalte der ursprünglichen Map enthält, aber mit einem zusätzlichen Eintrag, der die Inhalte für eventuelle identische Schlüssel ersetzt.

Signatur:


map:put($map as map(*), $key as xs:anyAtomicType, $value as item()*) as map(*)

Siehe https://www.w3.org/TR/xpath-functions-31/#func-map-put


 <xsl:template match="/">
  <root>
   <put>
    <xsl:variable name="vmap3" 
         select="map:put($vmap, 1, 'Zenzi Zwecklos')"/>
    <xsl:for-each select="map:keys($vmap3)">
     <key nr="{.}">
      <xsl:value-of select="map:get($vmap3, .)"/>
     </key>
    </xsl:for-each>
   </put>
  </root>
 </xsl:template>

Das Ergebnis können Sie hier bestaunen:


<root>
 <put>
  <key nr="0">Hugo Holzflos</key>
  <key nr="1">Zenzi Zwecklos</key>
  <key nr="2">Resi Denzschlos</key>
 </put>
</root>

wg / 7. April 2020



Fragen? Anmerkungen? Tipps?

Bitte nehmen Sie Kontakt zu mir auf.






Vielen Dank für Ihr Interesse an meiner Arbeit.



V.i.S.d.P.: Wilfried Grupe * Klus 6 * 37643 Negenborn

☎ 0151. 750 360 61 * eMail: info10@wilfried-grupe.de

www.wilfried-grupe.de/map5.html