Hi,
I’m the project owner of the validator.
What would you like to see cleaned up about the XSD?
What is required to make it JAXB-XJC friendly, and would these changes require a fork of the XSD or does it stay compatible?
http://opensearchvalidator.codeplex.com/SourceControl/changeset/view/40737#385239
--
Tatham Oddie
au mob: +61 414 275 989, us cell: +1 213 280 9140, skype: tathamoddie
I forwarded this thread around within my organisation and got the below
responses. None good unfortunately. :s
--
Tatham Oddie
au mob: +61 414 275 989, us cell: +1 213 280 9140, skype: tathamoddie
-----Original Message-----
From: Colin Savage [mailto:colin....@readify.net]
Sent: Friday, 7 May 2010 9:03 AM
To: Tatham Oddie; Readify Tech
Subject: RE: [opensearch:378] Re: OpenSearchDescription XSD
Go for it.
Regards,
Colin Savage
Readify | Senior Developer
M: +61 401 426 178 | C: colin....@readify.net
-----Original Message-----
From: Tatham Oddie [mailto:tat...@oddie.com.au]
Sent: Friday, 7 May 2010 9:01 AM
To: Colin Savage; Readify Tech
Subject: RE: [opensearch:378] Re: OpenSearchDescription XSD
Bugger. Thanks Colin.
Do you mind if I forward your replies back to the
opens...@googlegroups.com list, as-is?
--
Tatham Oddie
au mob: +61 414 275 989, us cell: +1 213 280 9140, skype: tathamoddie
-----Original Message-----
From: Colin Savage [mailto:colin....@readify.net]
Sent: Friday, 7 May 2010 9:00 AM
To: Tatham Oddie; Readify Tech
Subject: RE: [opensearch:378] Re: OpenSearchDescription XSD
I don't think you'll be able to make the sequence random and enforce the
number of occurrences. It will make the schema ambiguous and it won't
validate.
Regards,
Colin Savage
Readify | Senior Developer
M: +61 401 426 178 | C: colin....@readify.net
-----Original Message-----
From: Tatham Oddie [mailto:tat...@oddie.com.au]
Sent: Friday, 7 May 2010 8:57 AM
To: Colin Savage; Readify Tech
Subject: RE: [opensearch:378] Re: OpenSearchDescription XSD
Right - that's what we have now but JAXB-XJC can't generate proxy classes
for it.
Changing the XSD to this makes it work:
<xs:element name="OpenSearchDescription">
<xs:complexType>
<xs:all>
But that's not valid any more as it defines the sequence of the elements
(irrelevant for deserializing, but means the XSD can't be used to validate
source documents).
I'm wondering if there's an option C that is both valid XSD and compatible
with JAXB-XJC. :)
Alternatively we'll just have to branch the XSD. :(
More detail in Oscar's email below.
--
Tatham Oddie
au mob: +61 414 275 989, us cell: +1 213 280 9140, skype: tathamoddie
-----Original Message-----
From: Colin Savage [mailto:colin....@readify.net]
Sent: Friday, 7 May 2010 8:53 AM
To: Tatham Oddie; Readify Tech
Subject: RE: [opensearch:378] Re: OpenSearchDescription XSD
What you want is an unbounded sequence of choices (min = 0, max = 1)
<root xmlns="http://tempuri.org/XMLSchema.xsd">
<bar></bar>
<bar></bar>
<baz/>
<foo/>
</root>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/XMLSchema.xsd"
xmlns:mstns="http://tempuri.org/XMLSchema.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<xs:element name="root">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:choice minOccurs="0" maxOccurs="1">
<xs:element name="foo"/>
<xs:element name="bar"/>
<xs:element name="baz"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Regards,
Colin Savage
Readify | Senior Developer
M: +61 401 426 178 | C: colin....@readify.net
-----Original Message-----
From: Tatham Oddie [mailto:tat...@oddie.com.au]
Sent: Friday, 7 May 2010 8:32 AM
To: Readify Tech
Subject: FW: [opensearch:378] Re: OpenSearchDescription XSD
Any XSD experts here? :)
We want to model an XSD that validates specific children, some required,
some only allowed once, and some repeating, without dictating the order.
For example:
<Parent>
<Child3>Hi</Child3>
<Child1>Hi</Child1>
<Child3>Hi</Child3>
</Parent>
With rules like:
Child 1 is required once.
Child 2 is optional.
Child 3 is required at least once, but can exist multiple times.
Any order is fine.
More details below.
--
Tatham Oddie
au mob: +61 414 275 989, us cell: +1 213 280 9140, skype: tathamoddie