GET IT ALL BACK TO ONE NAMESPACE. One schema in the part 2 and that is it.
This will simplify our life greatly and make MOWS less error prone.
-----Original Message-----
From: Murray, Bryan P.
[mailto:bryan.murray@hp.com]
Sent: Fri 11/19/2004 8:40 PM
To: fred.carter@amberpoint.com
Cc:
wsdm@lists.oasis-open.org
Subject: RE: [wsdm] Problem defining
Relationship XML
To be in the same namespace you need to use include. Some
tools don't behave well with include. Many specs avoid using
include.
Thus quoth Murray, Bryan P. (~ 11/19/2004 5:15 PM ~)...
I was using xsd.exe from MS .NET Framework
1.1.
The error is:
Schema validation warning: The content model must be
deterministic. Wildcard declaration along with a local element declaration
causes the content model to become ambiguous. An error occurred at .../wd-wsdm-muws-part2-1.0.xsd, (124,
4).
The message isn't very clear but I played around with
it until I discovered the problem I
reported.
Yeah, I understand the error
but I think it's wrong. Since the namespace on the xs:any must be
something ##other than muws-p1-xs...
Oh, I see. I think
this is a result of splitting things into p1 & p2. Since the other
two elements are in p1, they are also ##other than the p2 namespace. I
had my schema all in muws-p1-xs.
An alternate approach would be to
"extend" the namespace/schema and have them all in the same namespace.
That, too, will solve the problem. The p2 schema could include/import
the p1 schema, but all stay in the same namespace. I don't really see a
problem with that, but someone else might...
Bryan
Thus quoth
Murray, Bryan P. (~ 11/19/2004 4:47 PM ~)...
I am having a problem defining a schema for Relationship that validates.
The pseudo-schema for Relationship (from MUWS part2) is the following:
<muws-p2-xs:Relationship>
<muws-p2-xs:Name>xs:string</muws-p2-xs:Name> ?
<muws-p2-xs:Type>muws-xs:RelationshipType</muws-p2-xs:Type>
<muws-p2-xs:Participant Role="xs:anyURI">
<muws-p1-xs:ManageabilityEndpointReference/> *
<muws-p1-xs:ResourceID/> ?
{any}*
</muws-p2-xs:Participant>
<muws-p2-xs:Participant/>+
<muws-p2-xs:AccessEndpointReference>
wsa:EndpointReferenceType
</muws-p2-xs:AccessEndpointReference>?
{any}*
</muws-p2-xs:Relationship>
The problem I have run into is in defining the ParticipantType
complexType. I have tried the following:
<xs:complexType name="RelationshipParticipantType">
<xs:sequence>
<xs:element ref="muws-p1-xs:ManageabilityEndpointReference"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="muws-p1-xs:ResourceId"
minOccurs="0"/>
<xs:any minOccurs="0" maxOccurs="unbounded"
namespace="##other" processContents="lax"/>
</xs:sequence>
<xs:attribute name="Role" type="xs:anyURI" use="required"/>
<xs:anyAttribute namespace="##other"/>
</xs:complexType>
The error I am getting is that the 'any' is causing ambiguity because
there are no required elements - and all optional elements are from the
part1 namespace. All I need is a required element in any namespace to
make it validate.
Does anyone have any suggestions?
A better schema processor?
When I attempt to
validate the following with XmlSpy (v2005)
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:muws-p1-xs="urn:bar" targetNamespace="urn:bar">
<xs:element name="foo">
<xs:annotation>
<xs:documentation>Comment describing your root element</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ManageabilityEndpointReference"/>
<xs:element name="ResourceId"/>
<xs:complexType name="RelationshipParticipantType">
<xs:sequence>
<xs:element ref="muws-p1-xs:ManageabilityEndpointReference"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="muws-p1-xs:ResourceId"
minOccurs="0"/>
<xs:any minOccurs="0" maxOccurs="unbounded"
namespace="##other" processContents="lax"/>
</xs:sequence>
<xs:attribute name="Role" type="xs:anyURI" use="required"/>
<xs:anyAttribute namespace="##other"/>
</xs:complexType>
</xs:schema>
I had no problem. When I change the ##other (highlighted in red) to ##nay, it complained that that would make
things non-deterministic. Which makes sense...
I know this isn't much help, but I think it means you're right and that
?+*&%#$ schema processor leaves a bit to be desired...
/fred
Bryan
To unsubscribe from this mailing list (and be removed from the roster of the OASIS TC), go to http://www.oasis-open.org/apps/org/workgroup/wsdm/members/leave_workgroup.php.
--
Fred Carter / AmberPoint, Inc.
mailto:fred.carter@amberpoint.com
tel:+1.510.433.6525 fax:+1.510.663.6301
--
Fred Carter / AmberPoint, Inc.
mailto:fred.carter@amberpoint.com
tel:+1.510.433.6525 fax:+1.510.663.6301