To many 'any' in factory attributes document

Hi all, I don't know if others are having this issue, but my tooling doesn't like all the xsd:any that show up in the FactoryResourceAttributesDocumentType. The problem is this: BasicFactoryResourceAttributesDocumentType has: - stuff1 - stuff2 - ... - xsd:any Then the FactoryResourceAttributesDocumentType has: - stuff1 (from extension) - stuff2 (from extension) - ... - xsd:any (from extension) - otherstuff1 - otherstuff2 - ... - xsd:any That makes two xsd:any in one complex type, which is one too many in my opinion. Can we perhaps refactor this type? I've also noticed that I can only provide one OperatingSystem, CPUArchitecture, etc, etc, which doesn't allow me to list the elements of my cluster. How about something like: <xsd:complexType name="ResourceAttributesDocumentType"> <xsd:sequence> <xsd:element name="OperatingSystem" type="jsdl:OperatingSystem_Type" minOccurs="0"/> <xsd:element name="CPUArchitecture" type="jsdl:CPUArchitecture_Type" minOccurs="0"/> <xsd:element name="CPUCount" type="xsd:unsignedInt" minOccurs="0"/> <xsd:element name="CPUSpeed" type="xsd:unsignedLong" minOccurs="0"/> <xsd:element name="PhysicalMemory" type="xsd:unsignedLong" minOccurs="0"/> <xsd:element name="VirtualMemory" type="xsd:unsignedLong" minOccurs="0"/> <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required"/> </xsd:complexType> <xsd:element name="ResourceAttributesDocument" type="ResourceAttributesDocumentType/> <xsd:complexType name="FactoryResourceAttributesDocumentType"> <xsd:complexContent> <xsd:sequence> <xsd:element ref="ResourceAttributesDocument" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="IsAcceptingNewActivities" type="xsd:boolean" minOccurs="1" maxOccurs ="1"/> <xsd:element name="CommonName" type="xsd:string" minOccurs="0" maxOccurs ="1"/> <xsd:element name="LongDescription" type="xsd:string" minOccurs="0" maxOccurs ="1"/> <xsd:element name="TotalNumberOfActivities" type="xsd:unsignedInt" minOccurs="1" maxOccurs ="1"/> <xsd:element name="LocalResourceManagerType" type="xsd:QName"/> <xsd:element name="ActivityReference" type="wsa:EndpointReferenceType" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="ContainedResourceAttributes" type="xsd:anyType" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="NamingProfile" type="xsd:QName" minOccurs="1" maxOccurs ="1"/> <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> Even if we don't refactor like I suggested, we need to control the xsd:any's. -- Chris

Christopher Smith wrote:
I don't know if others are having this issue, but my tooling doesn't like all the xsd:any that show up in the FactoryResourceAttributesDocumentType. [...] That makes two xsd:any in one complex type, which is one too many in my opinion.
Can we perhaps refactor this type? I've also noticed that I can only provide one OperatingSystem, CPUArchitecture, etc, etc, which doesn't allow me to list the elements of my cluster. [...] Even if we don't refactor like I suggested, we need to control the xsd:any's.
I've hit this before and it is distinctly unpleasant. The problem is that the XML Schema specification is very weak in this area; the schema working group doesn't seem to view things in quite the same way as the rest of the world. :-\ There does appear to be a way to get what you want within the model of the schema, and that is to first use complex type restriction to strip the xs:any to make a "trimmed base type", and then extend that with the extra elements, finishing off with the xs:any. The main down-sides of this are that it is ugly and who knows how anyone's tooling copes with it? Myself, I've tended to end up writing out the whole document type in full when I've had to do that sort of thing instead, and only adding the xs:any at the end by a final stage to apply it. But that's disgusting in other ways. As a side note, this is compatible with WS-ResourceProperties 1.2, but I know that at least one implementation would have choked on it at one point since this is getting into the wilder parts of schema processing. Now I need to floss my brain. Too much reading of W3C specs! Donal.

Donal K. Fellows wrote:
Christopher Smith wrote:
I don't know if others are having this issue, but my tooling doesn't like all the xsd:any that show up in the FactoryResourceAttributesDocumentType. [...] That makes two xsd:any in one complex type, which is one too many in my opinion.
Can we perhaps refactor this type? I've also noticed that I can only provide one OperatingSystem, CPUArchitecture, etc, etc, which doesn't allow me to list the elements of my cluster. [...] Even if we don't refactor like I suggested, we need to control the xsd:any's.
I've hit this before and it is distinctly unpleasant. The problem is that the XML Schema specification is very weak in this area; the schema working group doesn't seem to view things in quite the same way as the rest of the world. :-\
There does appear to be a way to get what you want within the model of the schema, and that is to first use complex type restriction to strip the xs:any to make a "trimmed base type", and then extend that with the extra elements, finishing off with the xs:any. The main down-sides of this are that it is ugly and who knows how anyone's tooling copes with it?
Or simply start out with a non-any complexType that both the basic and full resource attributes types extend.
Myself, I've tended to end up writing out the whole document type in full when I've had to do that sort of thing instead, and only adding the xs:any at the end by a final stage to apply it. But that's disgusting in other ways.
As a side note, this is compatible with WS-ResourceProperties 1.2, but I know that at least one implementation would have choked on it at one point since this is getting into the wilder parts of schema processing.
Now I need to floss my brain. Too much reading of W3C specs!
Donal. -- ogsa-hpcp-wg mailing list ogsa-hpcp-wg@ogf.org http://www.ogf.org/mailman/listinfo/ogsa-hpcp-wg

So what do people think of my suggested refactoring in my original email? It allows for both the resources section and factory section to accept any content, and it allows for listing multiple resources per factory. -- Chris On 18/10/06 06:44, "Peter G. Lane" <lane@mcs.anl.gov> wrote:
Donal K. Fellows wrote:
Christopher Smith wrote:
I don't know if others are having this issue, but my tooling doesn't like all the xsd:any that show up in the FactoryResourceAttributesDocumentType. [...] That makes two xsd:any in one complex type, which is one too many in my opinion.
Can we perhaps refactor this type? I've also noticed that I can only provide one OperatingSystem, CPUArchitecture, etc, etc, which doesn't allow me to list the elements of my cluster. [...] Even if we don't refactor like I suggested, we need to control the xsd:any's.
I've hit this before and it is distinctly unpleasant. The problem is that the XML Schema specification is very weak in this area; the schema working group doesn't seem to view things in quite the same way as the rest of the world. :-\
There does appear to be a way to get what you want within the model of the schema, and that is to first use complex type restriction to strip the xs:any to make a "trimmed base type", and then extend that with the extra elements, finishing off with the xs:any. The main down-sides of this are that it is ugly and who knows how anyone's tooling copes with it?
Or simply start out with a non-any complexType that both the basic and full resource attributes types extend.
Myself, I've tended to end up writing out the whole document type in full when I've had to do that sort of thing instead, and only adding the xs:any at the end by a final stage to apply it. But that's disgusting in other ways.
As a side note, this is compatible with WS-ResourceProperties 1.2, but I know that at least one implementation would have choked on it at one point since this is getting into the wilder parts of schema processing.
Now I need to floss my brain. Too much reading of W3C specs!
Donal. -- ogsa-hpcp-wg mailing list ogsa-hpcp-wg@ogf.org http://www.ogf.org/mailman/listinfo/ogsa-hpcp-wg
participants (3)
-
Christopher Smith
-
Donal K. Fellows
-
Peter G. Lane