element of complex type without type="" possible?

U

Ulf Heyder

Hello,

I have to deal with some xml schemas from a third party. This schema
contains the following complex type.

<?xml version="1.0"?>
<xsd:schema ... elementFormDefault="qualified">
....
<xsd:element name="Foobar" type="foo:FoobarType"/>
<xsd:complexType name="FoobarType">
<xsd:sequence>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="Value" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
....
</xsd:schema>

We worked with the schema collection for several months and never had any
failures when parsing and validating corresponding xml files which were
created against this schema by third party. XmlSpy names it well formed and
valid.

To me there seems to be a type missing in element "Value".

Exolab Castor 0.9.5 source generator creates the following lines in class
FoobarType...

private Value _value;

public Value getValue()
{
return this._value;
} //-- Value getValue()

public void setValue(Value value)
{
this._value = value;
} //-- void setValue(Value)

.... but no class "Value" is generated.

My question:
Is there a kind of default type in xml schema definition I didn't notice
til now?

If so: - Should source generator be informed about that?
If not: - Should source generator (and other parsers/validators) throw a
note for me about a type attribute missing in xsd?
- Can I rely on source generator checking the validity of the xml
schemas I please him to generate classes for?
- Is there a possibility to get this problem solved by binding
file?

Thanks, Ulf
 
P

Patrick TJ McPhee

% Is there a kind of default type in xml schema definition I didn't notice
% til now?

The default is anyType unless there's a ref, a substitutionGroup, or
an explicit type declaration as content.

% If so: - Should source generator be informed about that?

It probably ought to handle it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top