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

RE: What identifies an XML schema in XQuery, target namespace or schema location?

bryan rasmussen rasmussen.bryan at gmail.com
Thu Jan 10 10:54:37 PST 2008


  RE: What identifies an XML schema in XQuery
Does there seem to be a consensus yet as to how far the type
equivalence investigation goes?

Cheers,
Bryan Rasmussen

On Jan 10, 2008 6:50 AM, Michael Rys <http://x-query.com/mailman/listinfo/talk> wrote:
>
>
>
>
> The XQuery spec makes it clear that it is the namespace URI of the schema
> and the local name of the component that uniquely identifies a schema
> component. Since equivalence of schema components from different schema
> files is not defined in XQuery, the result is system-dependent on how far
> the type equivalence investigation goes during the compilation/linking of
> the two modules.
>
>
>
> Best regards
>
> Michael
>
>
>
>
>
> From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf
> Of Chen, Haifeng
>  Sent: Wednesday, January 09, 2008 6:34 PM
>  To: http://x-query.com/mailman/listinfo/talk
>  Subject:  What identifies an XML schema in XQuery, target
> namespace or schema location?
>
>
>
>
>
> Dear XQuery experts,
>
> I come to a question related to the schema import in XQuery. The following
> is the context,
>
>
>
> Given two XSD files named hats1.xsd and hats2.xsd (note: contents of these
> two files are the same) stored at the current directory as following,
>
> 1.   hats1.xsd (A schema defines a simple type HatSize)
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
> xmlns="http://www.hats.com/hats"
>
> targetNamespace="http://www.hats.com/hats">
>
>
>
> <xs:simpleType name="HatSize">
>
>         <xs:restriction base="xs:integer">
>
>             <xs:minInclusive value="1"/>
>
>             <xs:maxInclusive value="10"/>
>
>         </xs:restriction>
>
> </xs:simpleType>
>
>
>
> </xs:schema>
>
>
>
> 2.   hats2.xsd (A schema defines a simple type HatSize)
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
> xmlns="http://www.hats.com/hats"
>
> targetNamespace="http://www.hats.com/hats">
>
>
>
> <xs:simpleType name="HatSize">
>
>         <xs:restriction base="xs:integer">
>
>             <xs:minInclusive value="1"/>
>
>             <xs:maxInclusive value="10"/>
>
>         </xs:restriction>
>
> </xs:simpleType>
>
>
>
> </xs:schema>
>
>
>
> Given two XQuery files named module1.xq and module2.xq stored at the current
> directory as following,
>
>
>
> 3.   module1.xq (A module contains a function simply return a HatSize
> instance, importing schema hats1.xsd)
>
>
>
> module namespace module1="http://www.hats.com/module1";
>
> import schema namespace hats="http://www.hats.com/hats" at "hats1.xsd";
>
>
>
> declare function module1:function1() as hats:HatSize
>
> {
>
> 5 cast as hats:HatSize
>
> };
>
>
>
> 4.   module2.xq (Main module call the function and test instance of HatSize
> over the instance, importing schema hats2.xsd)
>
>
>
> import module namespace module1="http://www.hats.com/module1" at
> "module1.xq";
>
> import schema namespace hats="http://www.hats.com/hats" at "hats2.xsd";
>
>
>
> module1:function1() instance of hats:HatSize
>
>
>
> Question:
>
>
>
> What's the right result when evaluating on module2.xq?
>
> A.   true
>
> B.   false
>
> C.   static error should be raised
>
> D.   dynamic error should be raised
>
>
>
> It is actually asking "what identifies an XML schema, target namespace or
> schema location?"
>
>
>
> Thanks,
>
> Haifeng Chen
>
>
>
>
> _______________________________________________
> http://x-query.com/mailman/listinfo/talk
> http://x-query.com/mailman/listinfo/talk
>


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-2013 All Rights Reserved.