Changes

Jump to navigation Jump to search
1,850 bytes added ,  10:49, 15 December 2021
no edit summary
| '''Summary'''
|Transforms the document specified by {{Code|$input}}, using the XSLT template specified by {{Code|$stylesheet}}, and returns the result as string. The semantics of {{Code|$params}} and {{Code|$options}} is the same as for [[#xslt:transform|xslt:transform]].<br />
|-
| '''Error'''
|{{Error|error|#Errors}} an error occurred during the transformation process.
|}
 
==xslt:transform-report==
 
{{Mark|Introduced with Version 10.0:}}
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|xslt:transform-report|$input as item(), $stylesheet as item()|xs:string}}<br />{{Func|xslt:transform-report|$input as item(), $stylesheet as item(), $params as map(*)?|xs:string}}<br />{{Func|xslt:transform-report|$input as item(), $stylesheet as item(), $params as map(*)?, $options as map(*)?|xs:string}}
|-
| '''Summary'''
|Transforms the document specified by {{Code|$input}}, using the XSLT template specified by {{Code|$stylesheet}}, and returns the result a map with the following keys:
* {{Code|result}}: The transformation result: A document node or an item of type {{Code|xs:untypedAtomic}}.
* {{Code|error}} (optional): An error string.
* {{Code|messages}}: Info output generated with the {{Code|xsl:message}} element: A sequence of arrays, containing the messages as XML elements or items of type {{Code|xs:untypedAtomic}}.
The semantics of {{Code|$params}} and {{Code|$options}} is the same as for [[#xslt:transform|xslt:transform]].<br />
|-
| '''Error'''
'''Query:'''
<syntaxhighlight lang="xquery">
xslt:transform-textreport(<dummy/>, 'basic.xslt')
</syntaxhighlight>
<v>1</v>
<v>1</v>
</syntaxhighlight>
 
'''Example 4: XSL transformation, yielding a result and info messages'''
 
'''Query:'''
<syntaxhighlight lang="xquery">
xslt:transform-report(
<_/>,
<xsl:transform version='2.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match='/'>
<xsl:message><msg>START...</msg></xsl:message>
<xml>123</xml>
<xsl:message select='4, 5, "...END"'/>
</xsl:template>
</xsl:transform>
)
</syntaxhighlight>
 
'''Result:'''
<syntaxhighlight lang="xquery">
map {
"messages": ([<msg>START...</msg>], ["4 5 ...END"]),
"result": <xml>123</xml>
}
</syntaxhighlight>
=Changelog=
 
;Version 10.0
* Added: [[#xslt:transform-report|xslt:transform-report]]
;Version 9.2
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu