OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

sca-assembly message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [sca-assembly] Issue 14


Ashok,

I didn't see a xs:anyAtomicType at 
http://www.w3.org/TR/xmlschema-2/#built-in-datatypes
Is this something that is in the next version of schema?

I was trying to find out about the restriction that you are talking 
about in schema. I couldn't. Can you send me a pointer? Thx.

I tried the following using XMLSpy 2006 sp2 --

XSD:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
targetNamespace="http://example.org/test"; elementFormDefault="qualified" 
attributeFormDefault="unqualified">
	<xs:element name="value" type="xs:anyType"/>
	<xs:simpleType name="st">
		<xs:restriction base="xs:string"></xs:restriction>
	</xs:simpleType>
	<xs:complexType name="ct">
		<xs:simpleContent>
			<xs:extension base="xs:string">
			  <xs:attribute name="attr" type="xs:string"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
</xs:schema>

XML instance with simple type:

<?xml version="1.0" encoding="UTF-8"?>
<value xmlns="http://example.org/test";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://example.org/test
                            assembly_issue_14.xsd"
        xsi:type="st">
some string value
</value>

XML instance with complex type:

<?xml version="1.0" encoding="UTF-8"?>
<value xmlns="http://example.org/test";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://example.org/test
                            assembly_issue_14.xsd"
        xsi:type="ct"
        attr="some attr value">
some element value
</value>

It worked the way I was hoping to work. Validating both the XML 
documents above and not validating XML documents that do not conform to 
the declared xsi:type value.

-Anish
--

ashok malhotra wrote:
> Here is a proposal that will work.
> 
> Define an element called <ComplexValue> that has Schema type xs:anyType.
> Use xsi:Type to indicate the precise complex type used.
> 
> Define an element called <SimpleValue> that has Schema type 
> xs:anyAtomicType.
> Use xsi:Type to indicate the precise type used.
> 
> I'll talk with my Schema colleagues to see if we can get away with a 
> single value type.


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]