Subject: "Open Enumerations"
At the WS-I basic security profile face-to-face last week, there was some discussion about the fact that there are extension points in WS-Sec, with a few well-known QNAME and/or URI's. For example, the Qname to use when sending a SOAP Fault, or the URI to use in the valueType attribute. At that meeting, Martin Gudgin, or "gudge," mentioned a techique he's using in some of the other committees he's on. (The list is daunting, and includes SOAP, WSDL, etc etc. The man clearly has a cast-iron constitution.) There had been some discussion of this on one of the other mailing lists, but since he's not on the WSS list, many folks here never saw it. To cut to the chase, I'm forwarding one of the latest messages in that thread, which explains his "open enumeration" schema technique in detail. At this point, I think it's just an "FYI" matter. But it is a clever use of schema, and something to consider for future work. /r$ -- Rich Salz, Chief Security Architect DataPower Technology http://www.datapower.com XS40 XML Security Gateway http://www.datapower.com/products/xs40.html XML Security Overview http://www.datapower.com/xmldev/xmlsecurity.html
--- Begin Message ---
- From: "Martin Gudgin" <email@example.com>
- To: "Eve L. Maler" <Eve.Maler@Sun.COM>
- Date: Mon, 2 Feb 2004 08:51:20 -0800OK, so here is the 'cute hack' ;-) Assuming in scope ns decls for xs, tns and foo... First, define your enumeration as normal: <xs:simpleType name='MyEnum' > <xs:restriction base='xs:QName' > <xs:enumeration value='foo:Val1' /> <xs:enumeration value='foo:Val2' /> <xs:enumeration value='foo:Val3' /> </xs:restriction> </xs:simpleType> Second, define a union of your enumerated type and the base ( in that order ): <xs:simpleType name='MyOpenEnum' > <xs:union memberTypes='tns:MyEnum xs:QName' /> </xs:simpleType> Third, stir one part open enum with one part element or attribute decl: <xs:element name='MyData' type='tns:MyOpenEnum' /> Legal values for MyData element include the QNames defined in the MyEnum and any other QName. Attached schema validates good1.xml, good2.xml, good3.xml and fails bad1.xml Gudge > -----Original Message----- > From: Eve L. Maler [mailto:Eve.Maler@Sun.COM] > Sent: 02 February 2004 16:38 > To: Martin Gudgin > Cc: Paul Cotton; Christopher B Ferris; Rich Salz; Reid, > Irving; Peter Dapkus; DeMartini, Thomas; firstname.lastname@example.org > Subject: Re: [wss] Critical ISSUE (RE: [wss-comment] > Enumerations of QName fault codes) > > Yikes. Mea culpa! I hadn't noticed that the enumeration was > actually typed with QName; somehow I thought it was in the > string value space. > This would make the "cute hack" a worthwhile one, after all. > > Eve > > Martin Gudgin wrote: > > > I don't understand > > > > "still makes the wsse: prefix a unique first-class citizen" > > > > Defining QNames in a schema enumeration fixes the URI and > Local Name > > parts, not the prefix part... > > > > Gudge > > > > P.S. I note that the WSS list is bouncing my posts ( understandably > > given I'm not on the TC ), could someone re-post as > appropriate? Thanks. > > -- > Eve Maler +1 781 442 3190 > Sun Microsystems cell +1 781 354 9441 > Web Products, Technologies, and Standards eve.maler @ sun.com > >
openenum.xsd<a:MyData xmlns:a='http://example.org/types' >This is not a QName</a:MyData><a:MyData xmlns:a='http://example.org/types' xmlns:b='http://example.org/stuff' >b:Val2</a:MyData><a:MyData xmlns:a='http://example.org/types' xmlns:foo='http://example.org/stuff' >foo:Val3</a:MyData><a:MyData xmlns:a='http://example.org/types' xmlns:bar='http://example.org/otherstuff' >bar:SomeOtherName</a:MyData>--- End Message ---