[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

What exactly does schema-element

Jens T Teubner teubner at us.ibm.com
Thu Nov 8 17:51:59 PST 2007


  What exactly does schema-element
http://x-query.com/mailman/listinfo/talk wrote on 11/08/2007 04:29:51 PM:

> i have a question concerning the difference between element and 
> schema-element test? I've read the xsd spec at w3c's but still didn't 
> get behind the meaning of it.

Timothy,

the test

  element(n,t)

tests whether an element has the name n and the type annotation t.

By contrast, the test

  schema-element(n)

looks up the global element declaration for n in your imported XML
Schema document.  Then, it tests, whether the name of your node under
investigation is compatible with that element declaration (substitution
groups are respected here) and whether it matches the type that is
required in the global element declaration for n.

So schema-element() does a bit more in the sense that it does the
lookup in the XML Schema document.  In the presence of substitution
groups, the schema-element() test can also be a bit more permissive
than element() (which strictly looks at the element's name).

Jens

-- 
Jens Teubner
IBM T.J. Watson Research Center
19 Skyline Drive, Hawthorne, NY 10532
+1 914 784 7179


Purchase Stylus Studio Online Today!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.