Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[XML Schema 1.1] Using doc() in xs:assert ... the referenced document needs a schema?

From: "Costello, Roger L." <costello@-----.--->
To: "'xmlschema-dev@--.---'" <-------------@--.--->
Date: 4/27/2009 6:18:00 AM
Hi Folks,

Here's a simple schema that uses xs:assert to check that the value of the <=
country> element matches one listed in an instance document (countries.xml)=
:

---------------------------------------------------------------
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
        elementFormDefault="qualified">

    <element name="Example">
        <complexType>
            <sequence>
                <element name="country">
                    <simpleType>
                        <restriction base="string">
                            <assert test="$value = doc('countries.xml')=
//country" />
                        </restriction>
                    </simpleType>
                </element>
            </sequence>
        </complexType>
    </element>

</schema>
---------------------------------------------------------------


While running this example, I discovered these requirements:

   - the instance document referenced by xs:assert (countries.xml) 
     must have a schema, and 

   - I have to import that schema. 

Why?

These requirements don't seem reasonable to me. 

I should be able to reference any instance document (under my control or ot=
herwise) and use it as a data source.

These requirements mean:

   - I can't reference instance documents that don't have a schema

   - I can't reference instance documents that uses some other
     schema language, such as DTD or RELAX NG.

   - Everything is tightly coupled: the schema, the referenced 
     instance document and its schema. I can't easily switch to 
     another instance document and use it as a data source.


Would someone please explain the rationale for these requirements?

/Roger=

From mike@s... Mon Apr 27 14:42:03 2009
Received: from bart.w3.org ([128.30.52.63])
	by frink.w3


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent