xsl-list
[Top] [All Lists]

Re: [xsl] Schema-awareness and built-in types

2014-06-13 15:01:30
Max,

What happens when you do this?

<xsl:element name="a" type="xs:integer">
  <xsl:sequence select="5"/>
</xsl:element>

or even select="xs:integer(5)" ...?

I suppose I could always try. :->

Cheers, Wendell

On Wed, Jun 11, 2014 at 11:45 AM, Max Toro maxtoroq(_at_)gmail(_dot_)com
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:
The following doesn't work in an XSLT processor with basic conformance:

<xsl:element name="a" type="xs:integer">5</xsl:element>

even though you can create variables using the built-in types:

<xsl:variable name="a" select="5" as="xs:integer"/>

or use the constructor functions:

<xsl:variable name="a" select="xs:integer('5')"/>

What's the reason for this restriction? Why can't I use built-in types
to annotate new nodes?
--
Max Toro




-- 
Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^
--~----------------------------------------------------------------
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>