xsl-list
[Top] [All Lists]

Re: [xsl] Avoiding boneheaded mistakes in XSLT?

2010-12-29 13:38:45
So for some C you will have errors/unmatched xpaths
others you won't.
 I'd prefer to know of them rather than 'assume'
they are OK.

It sounds like you are asking the (non schema aware) processor to
report warnings for content that isn't present?

You can kind of do that sort of thing by using the as attribute:

<xsl:template match="whatever">
  <xsl:variable name="foo" select="path/to/foo" as="element(foo)"/>
  <xsl:apply-templates select="$foo"/>

The above will fail with an error if foo is not a child of whatever/path/to.




-- 
Andrew Welch
http://andrewjwelch.com

--~------------------------------------------------------------------
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>
--~--