RE: [xsl] XSLT 2.0, using Schema-aware features

Subject: RE: [xsl] XSLT 2.0, using Schema-aware features
From: "Bill Riegel" <BRiegel@xxxxxxx>
Date: Fri, 12 Jan 2007 10:48:06 -0600
Thanks for the reply.

My main goal is to verify the xslt queries match the incoming data (
that is the incoming defined schema )

If the Input is
	<foo>
	   <name>John Smith</name>
	</foo>

and if there is a template match on "foo" and within that template
there is a statement:
	<xsl:value-of select="name"/>


I would like to verify that there is a "name" type defined under foo.

So if the schema changes in the future, and "name" becomes "person", I'd
like the processor to inform me that name is invalid in this scope.

I have achieved this functionality by using the schema-aware saxon,
But when I tried the same xslt file with the non-schema aware version,
it fails

I.e I was using features like <xsl:template match="element(foo, some
schema type )"

I have control over the schema's and was going to try to re-stucuture
them
To remove use of the global <xs:complexType> to <xs:element> to see
If I could remove the need for

  <xsl:template match="element(foo, some schema type )"

and use just

  <xsl:template match="foo">

with foo being a <xs:element > definition in the schema.



Bill Riegel
LandMark Graphics
Phone: 713-839-3388
Fax: 713-839-3051

-----Original Message-----
From: Mukul Gandhi [mailto:gandhi.mukul@xxxxxxxxx]
Sent: Friday, January 12, 2007 10:33 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] XSLT 2.0, using Schema-aware features

this is certainly a very insightful answer :)

On 1/12/07, David Carlisle <davidc@xxxxxxxxx> wrote:
>
> > Could someone indicate the best source of info describing this
> > workflow
>
> I don't know of any existing sources  but no doubt people here could
> speculate on good practice.
>
> I think it depends a bit on how much you really want to use schema
> features.
>
> If you just want to validate input and result for example, I think it
> should be fairly easy to set up stylesheet defined functions or named
> templates that use validation, or don't depending on whether the
engine
> is schema-aware, then in the rest of the stylesheet you can just use
> these functions without having explict schema-aware tests everywhere.
>
>
> If on the other hand you not only want to validate the input to check
> for correctness, but also want to annotate the input tree with type
> information and use that in template matching and to avoid explict
> casting when calling fuunctions (as the input already has the right
> type, such as a date type for example) then I think the only answer
> could be don't do that. A basic level processor not only can't call
the
> schema validator, it's not allowed to use a type annotated tree from
any
> source (whicle acting at that conformance level).
>
> David


--
Regards,
Mukul Gandhi

----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and
privileged information for the sole use of the intended recipient.  Any
review, use, distribution, or disclosure by others is strictly prohibited.  If
you are not the intended recipient (or authorized to receive information for
the intended recipient), please contact the sender by reply e-mail and delete
all copies of this message.

Current Thread