xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] (Possible) pitfall: XSLT 2, 9.4 Creating implicit document nodes


Subject: Re: [xsl] (Possible) pitfall: XSLT 2, 9.4 Creating implicit document nodes
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Wed, 09 May 2012 16:47:12 +0100

On 09/05/2012 16:02, Christian Roth wrote:
Hello,

this is a heads-up for a pitfall (that at least I have fallen into several times now...)

Is there a technique or pattern I could employ (maybe utilizing the @as attribute somehow?)

Firstly, avoid creating temporary trees where you don't need them. Whenever you find yourself using xsl:variable with content, ask yourself whether you shouldn't be using the @select attribute instead.


Secondly, always use the @as attribute to declare the type of the variable you think you are creating. When you declare your types, the compiler can tell you about your mistakes.

Michael Kay
Saxonica


Current Thread
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor