|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XPath 2.0 Best Practice: wrap the first node of ev
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
|
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
|






