[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: instance-of schema-element
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? -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|