xsl-list
[Top] [All Lists]

Re: [xsl] constructing arrays in XSLT with templates

2021-06-18 13:50:10
On 18.06.2021 20:45, Martin Honnen martin(_dot_)honnen(_at_)gmx(_dot_)de wrote:
Of course for the limited sample you could be tempted to inline anything
as an XPath 3.1 expression.

Like this:

  <xsl:template match="/">
    <xsl:sequence
      select="map {
               'books' : array {
                  books/book ! map {
                    'title' : title!string(),
                    'authors' : array { author/string() }
                  }
                }
              }"/>
  </xsl:template>
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>