xsl-list
[Top] [All Lists]

Re: [xsl] constructing arrays in XSLT with templates

2021-06-19 05:37:09

Am 19.06.2021 um 12:30 schrieb Alan Painter 
alan(_dot_)painter(_at_)gmail(_dot_)com:
*map:entry('out-of-print', true())[current()/@out-of-print eq 'true']*


*I think you would need to write e.g.*

*  if (@out-of-print eq 'true') then map:entry('out-of-print', true())
else ()*

*
*

Or you would need to use a for expression to bind a "book" e.g.


    map {
      'books' : array {
        for $book in books/book return map:merge((
          map:entry('title',        $book!title !string()   ),
          map:entry('authors',      array { $book!author!string() } ),
*          map:entry('out-of-print', true())[$book/@out-of-print eq 'true']*
        ))
      }
    }
--~----------------------------------------------------------------
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>