Page 1 of 1

List enumeration values out of the schema

Posted: Fri Dec 10, 2004 12:17 am
by nexius
First of all, fantastic program

It would be nice if for enumeration tags it listed the possible values to choose from, like the way it lists the possible tags.

Posted: Fri Dec 10, 2004 12:26 pm
by george
Hi,

Oxygen handles enumerations and presents these values when attribute values are inserted. It follows simple types also on unuions and lists to get the enumeration values. Do you mean something different?

You may consider also useful changing the content completion source from the schema to the document structure and back. To use the document structure use the Learn structure action. This will learn also all attribute values. To go back to the schema driven content completion perform a validation action.

Best Regards,
George

Posted: Sat Dec 11, 2004 8:53 pm
by nexius
You're right, it does list them conveniently for attributes. But it doesn't appear to do this for the values of tags. That's what I meant

I'll try the learn structure feature, thanks

Posted: Sat Dec 11, 2004 10:04 pm
by george
Hi,

That will be available in the next release together with some other content completion improvements.

Best Regards,
George

Posted: Mon Mar 21, 2005 11:57 pm
by nexius
I have oxygen version 5.1 and this feature does not appear to be included
Which version will have this feature?

Posted: Tue Mar 22, 2005 12:01 pm
by george
Hi,

It was included in version 5.1. Try for instance the following schema: test.xsd

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="root">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element ref="test"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="test" type="Test"/>
<xs:simpleType name="Test">
<xs:restriction base="xs:string">
<xs:enumeration value="v1">
<xs:annotation>
<xs:documentation>The first value</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="v2">
<xs:annotation>
<xs:documentation>The second value</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:schema>
with an instance like:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="test.xsd" test="v1">
<test></test>
</root>
It is true that this does not work if the simple type is anonymous. This problem is already fixed in the current development stream.

Best Regards,
George