xsl-list
[Top] [All Lists]

[xsl] [XPath 3.0] Can anonymous functions return markup?

2012-12-16 16:07:39
Hi Folks,

I want to create an anonymous XPath function that returns markup. For example:

         let $print := function ()
                              {
                                  <hello>World</hello>
                              }
         return ($print())

I tried embedding that XPath within an xsl:sequence element:

      <xsl:sequence select="
         let $print := function ()
                              {
                                  <hello>World</hello>
                              }
         return ($print())
         " />

but that produced this error message:

    The value of attribute "select" associated with an element 
    type "xsl:sequence" must not contain the '<' character.

So I escaped the '<' characters:

      <xsl:sequence select="
         let $print := function ()
                              {
                                  &lt;hello>World&lt;/hello>
                              }
         return ($print())
         " />

and that produced this error message:

    Unexpected token "<" in path expression

Is it possible to create an anonymous function that returns markup? 

If yes, how?

/Roger

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


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