xsl-list
[Top] [All Lists]

Re: [xsl] Template-matching nodes from input vs nodes in variable based on their position

2015-06-18 00:43:40
Simply don't specify any type for the $FOO variable:

 <xsl:variable name="FOO">
  <page>Page number 1</page>
  <page>Page number 2</page>
  <page>Page number 3</page>
  <page>Page number 4</page>
  <page>Page number 5</page>
  <page>Page number 6</page>
  <page>Page number 7</page>
 </xsl:variable>

The type by default is a document node, and in this case the provided
transformation produces the expected result.


Cheers,
Dimitre

On Wed, Jun 17, 2015 at 10:15 PM, Jorge . 
chocolate(_dot_)camera(_at_)gmail(_dot_)com
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:
On Wed, Jun 17, 2015 at 9:18 PM, Martin Honnen 
martin(_dot_)honnen(_at_)gmx(_dot_)de
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:
Try
  as="document-node()"

It won't work:

    Error at xsl:variable on line 5 column 51 of stylesheet.xsl:
      XTTE0570: Required item type of value of variable $FOO is
      document-node(); supplied value has item type element()
    Failed to compile stylesheet. 1 error detected.

I use document-node() as the type of a variable when importing an
external XML file into the variable. But in this case, I write the
contents of the variable in the stylesheet itself.




-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
-------------------------------------
To achieve the impossible dream, try going to sleep.
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they
write all patents, too? :)
-------------------------------------
Sanity is madness put to good use.
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.
--~----------------------------------------------------------------
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>