W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2002

Modelling Java Classes in XSD

From: Andrew Sealy-Bell <asealybell@enterpriseis.co.uk>
Date: Tue, 2 Apr 2002 11:19:23 -0500 (EST)
To: <xmlschema-dev@w3.org>
Message-ID: <37136AEFBA03D411900500062938629321C069@eis003.enterpriseis.co.uk>
Hi, I have used Electric XML + to create a set of schemas from a java class.
This works fine, but Electric XML+ stops when it hits standard Java classes
(obviously it might be stupid as it would create thousands of complex XSD's
as it moves up the class hierarchy).

The question is, what would be an acceptable way to mark the point where you
want to stop modelling your object? i.e. I have the following schema:

<schema xmlns='http://www.w3.org/2001/XMLSchema'

targetNamespace='http://www.themindelectric.com/package/uk.co.enterpriseis.c
ollections.base.persistent/'
	xmlns:electric='http://www.themindelectric.com/schema/'>
    <complexType name='Collection' abstract='true'>
      <sequence>
        <element name='fieldCollection' nillable='true'
electric:field='fieldCollection'
xmlns:ns3='http://www.themindelectric.com/package/java.util/'
type='ns3:Collection'/>
      </sequence>
    </complexType>
  </sche
which marks "fieldCollection" as type "ns3:Collection" (effectively marking
it as a java.util.Collection).  The problem is that if you run this through
a schema validator (such as the one I use, the IBM Schema Quality Checker)
it will complain as follows:
	"Type http://www.themindelectric.com/package/java.util/:Collection is not
found.
	There is no import statement associated with the namespace
'http://www.themindel
	ectric.com/package/java.util/'."
and quite rightly too as the type is not found.  As I mentioned before, I
want to mark this in some acceptable way as being a java.util.Collection
without defining java.util.Collection in an XSD.

I would appreciate any thoughts on this.

Andrew Sealy-Bell.
Received on Wednesday, 3 April 2002 03:50:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:30 GMT