Replacement of and in XSL

后端 未结 2 1329
情歌与酒
情歌与酒 2021-01-23 18:53

I am trying to modify an xsl which is of the older version. I come across the following:

FormatAccount(this)


         


        
相关标签:
2条回答
  • 2021-01-23 19:41

    Embedded extension functions in other language is not the content model of XSLT.

    Extension elements and extension functions are part of the content model as described in http://www.w3.org/TR/xslt#extension : it's implementation dependant how exactly an XSLT processor register those extensions.

    As pointed by @Martin Honnen's answer, in XSLT 2.0 you can declare "stylesheet functions" with XSLT itself.

    0 讨论(0)
  • 2021-01-23 19:53

    The latest standard is XSLT 2.0 http://www.w3.org/TR/xslt20/, it does not have any facility to define functions in Javascript, it however allows you to define functions with XSLT itself: http://www.w3.org/TR/xslt20/#stylesheet-functions. XSLT 2.0 is supported by XSLT 2.0 processors like Saxon 9 http://saxon.sourceforge.net/, AltovaXML Tools http://www.altova.com/altovaxml.html or XQSharp http://www.xqsharp.com/xqsharp/beta.htm.

    If you want to use Javascript to define extension functions we need to know which XSLT processor you use, of those three XSLT 2.0 processors I mentioned I think only AltovaXML Tools allows that (http://manual.altova.com/AltovaXML/altovaxmlcommunity/index.html?xextmsxsl.htm), and only, I think, to allow easier migration of XSLT 1.0 stylesheets written for Microsoft MSXML.

    If you want to use an XSLT 1.0 processor then there too defining extension functions in a particular programming language like Javascript depends on the processor you use, for MSXML there is an msxsl:script element: http://msdn.microsoft.com/en-us/library/ms256042.aspx.

    0 讨论(0)
提交回复
热议问题