Subject: Re: [xsl] XPath 2.0 Best Practice: wrap the first node of every path expression within schema-element? From: Florent Georges <lists@xxxxxxxxxxxx> Date: Thu, 27 Mar 2008 13:41:13 +0100 (CET) |
Mukul Gandhi wrote: Hi > For this case, some form of static error reporting is already > defined in the XPath 2.0 spec. Please see: > http://www.w3.org/TR/xpath20/#id-schema-element-test > <quote> > schema-element(ElementName) > If the ElementName specified in the SchemaElementTest is not found in > the in-scope element declarations, a static error is raised > [err:XPST0008]. > </quote> That is not the same thing. In the Roger's suggestion, you set up the static type of a step in a path (for instance explicitely, via a variable, or in the initial context if the path is in an XSLT template rule with schema-element as pattern.) Knowing on the one hand the static type at one step, and on the other hand the schema, the processor is able to deduce the possible steps (according to the schema) for most of the following steps (depending on the schema and the following steps themselves.) And in order to use schema-element, you must have a global element in the schema. For instance: <xs:element name="author" type="author.type"/> <xs:complexType name="author.type"> <xs:sequence> <xs:element name="first-name" type="xs:string"/> </xs:sequence> </xs:complexType> How could you be sure the processor will check that 'first-name' is not misspelled in the following expression: schema-element(author)/first-name ? Regards, --drkm _____________________________________________________________________________ Envoyez avec Yahoo! Mail. Capaciti de stockage illimitie pour vos emails. http://mail.yahoo.fr
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XPath 2.0 Best Practice: , Mukul Gandhi | Thread | Re: [xsl] XPath 2.0 Best Practice: , Florent Georges |
Re: [xsl] XPath 2.0 Best Practice: , David Carlisle | Date | Re: [xsl] XPath 2.0 Best Practice: , Mukul Gandhi |
Month |