XPath 2.0

XPath 2.0

XPath is being updated to offer more support for XSLT 2.0 (see www.w3.org/TR/xpath20req). XPath 2.0 has the following goals:

  • Simplify manipulation of XML schema-typed content.

  • Simplify manipulation of string content.

  • Support related XML standards.

  • Improve ease of use.

  • Improve interoperability.

  • Improve international support.

  • Maintain backward compatibility.

  • Enable improved processor efficiency.

The following list provides an overview of the XPath 2.0 requirements. The big items on the agenda are XML schema support and support for regular expressions, which provide ways of handling string searches and manipulations. (For more on regular expressions, see www.perldoc.com/perl5.6/pod/perlre.html.) According to W3C, XPath 2.0

  • Must support the W3C XML architecture by integrating well with the other standards in the XML family.

  • Must express its data model in terms of the XML infoset.

  • Must provide a common core syntax for XSLT 2.0 and XML Query language 1.0.

  • Must support an explicit for any or for all comparison and equality syntax.

  • Must extend the set of aggregation functions. (For example, XSLT users have frequently requested the addition of min() and max().)

  • Should maintain backward compatibility with XPath 1.0.

  • Should provide intersection and difference functions; that is, XPath 1.0 supports the union of two node sets, and that should be expanded to include intersection and difference functions.

  • Should support a unary plus operator (because XML schema allows decimals to have a leading plus).

  • Must improve ease of use.

  • Must loosen restrictions on location steps.

  • Must provide a conditional expression that takes three expressions: expression1 (Boolean operator) expression2, and expression3. It must evaluate to expression2 if expression1 is true and to expression3 if expression1 is false.

  • Must define a consistent syntax for subexpressions that handle collections of items.

  • Should support additional string functions. For example, W3C is considering adding support to string replacement, string padding, and string case conversions.

  • Should support aggregation functions when applied to collections. For example, some XPath 1.0 users have wanted to apply an aggregate function, such as the sum function, to the values of expressions applied to node sets.

  • Must support regular expressions for matching in strings using the regular expression notation as established in XML schema.

  • Must add support for XML schema primitive datatypes. That is, in addition to the types supported by the XPath 1.0 data modelstring, number, Boolean, and node-setthe XPath 2.0 data model must support XML schema primitive types.

  • Must support the representations of floats and doubles supported by XML schema, which uses scientific notation.

  • Must define an appropriate set of functions to enable users to work with XML schema primitive types.

  • Should add a list data type to XPath (because XML schema allows the definition of simple types derived by a list).

  • Must support accessing simple-typed value of elements and attributes. Because XML schemas introduce many new types, XPath 2.0 must support access to the native, simple-typed value of an element or attribute.

  • Must define the behavior of operators for null arguments.

  • Should be able to select elements or attributes based on an explicit XML schema type.

  • Should be able to select elements or attributes based on XML schema type hierarchy.

  • Should be able to select elements based on XML schema substitution groups.

  • Should support lookups based on schema unique constraints and keys.

Although this is the end of the chapter, thats not all for XPath. This topic is continued in the next chapter, where youll get a closer look at the functions available in XPath and those functions that are already built into XSLT.

Inside XSLT
Inside Xslt
ISBN: B0031W8M4K
Year: 2005
Pages: 196

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net