Re: [xsl] Is an XPath processor responsible for catching misspelled tag names when there is an associated Schema?

Subject: Re: [xsl] Is an XPath processor responsible for catching misspelled tag names when there is an associated Schema?
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Thu, 21 Feb 2008 13:40:02 +0000
>  4.1 Is there a way to redesign the XPath such that the misspelling
>  error would be caught?

not in XPath but:

<xsl:variable name="authors" select="/book/author"
as="schema-element(author)+"/>

ensures one or more valid author elements are selected

>  4.2 Is there a way to redesign the XPath such that the misspelling
>  error would be caught, regardless of whether a schema-aware or
>  non-schema-aware processor is being used?

<xsl:variable name="authors" select="/book/author" as="element(author)+"/>

ensures one or more elements named "author" are selected

IDEs like oXygen provide intellisense based on the associated XML in
the scenario, but I don't know of any one which will highlight
impossible XPaths given a schema.

-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

Current Thread