Subject: Re: [xsl] instance-of schema-element From: John Snelson <john.snelson@xxxxxxxxxx> Date: Fri, 14 Mar 2008 15:44:55 +0000 |
On 14/03/2008, Florent Georges <lists@xxxxxxxxxxxx> wrote:Andrew Welch wrote:
> <xsl:if test="$foo instance of schema-element(foo)">
> ...does that mean $foo is validated at that point?
No. That will test if the dynamic type of $foo already matches schema-element(foo).
hmmm thought so - how can I validate $foo without it causing the transform to fail?
The problem I'm trying to solve is along the lines of:
- $foo and $bar are both hold very similar similar XML ( a before and after view of some XML in fact)
- if $foo is valid and $bar isn't, output $foo and vice versa
- if both are valid apply an extra layer of logic to decide which is output
- if neither are valid output nothing
With this approach I need some way of validating the XML from within the XSLT and then be able to handle any validation failures... something like:
<xsl:variable name="foo" as="document-node(schema-element(foo))"> <xsl:document validation="strict"> <foo/> </xsl:document> </xsl:variable>
...that won't cause the transform to fail, but allow me to test whether $foo is valid.
Any ideas?
-- John Snelson, Oracle Corporation http://snelson.org.uk/john Berkeley DB XML: http://www.oracle.com/database/berkeley-db/xml XQilla: http://xqilla.sourceforge.net
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] instance-of schema-elemen, Florent Georges | Thread | Re: [xsl] instance-of schema-elemen, Andrew Welch |
Re: [xsl] instance-of schema-elemen, Florent Georges | Date | Re: [xsl] instance-of schema-elemen, Andrew Welch |
Month |