![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - RE: Restricting attribute content to not include a specific string >Thread Next - AW: Restricting attribute content to not include a specific string AW: Restricting attribute content to not include a specific stringTo: <xmlschema-dev@--.---> Date: 4/21/2006 11:12:00 AM Hi list, Thank you very much for all your helpfull input. Maybe that would be a nice feature for XML Schema 1.1 to allow this kind = of "intersect" or "except" statements. Like for example: <xsd:attribute name="courtData"> <xsd:simpleType> <xsd:intersect> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:whiteSpace value="collapse"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:enumeration value="unknown"/> </xsd:restriction> </xsd:simpleType> </xsd:intersect> </xsd:simpleType> </xsd:attribute> I suppose that is not the best use case example, but I hope the = application of my idea is understandable, though ;) best regards, Roman > -----Urspr=FCngliche Nachricht----- > Von: Mary Holstege [mailto:holstege@m...] > Gesendet: Donnerstag, 20. April 2006 16:26 > An: Huditsch, Roman (LNG-VIE) > Betreff: Re: Restricting attribute content to not include a > specific string > > > Oh wait, I misread your question. To not include a specific string? > Regular expressions don't like that kind of constraint, so it > gets ugly. You have to have separate patterns for each > possible partial (but non-)match: > > <xs:simpleType name="attrValue"> > <xs:restriction base="xs:string"> > <xs:pattern value=""/> > <xs:pattern value="[^u].*"/> > <xs:pattern value="u[^n].*"/> > <xs:pattern value="un[^k].*"/> > <xs:pattern value="unk[^n].*"/> > <xs:pattern value="unkn[^o].*"/> > <xs:pattern value="unkno[^w].*"/> > <xs:pattern value="unknow[^n].*"/> > <xs:pattern value="unknown.+"/> > </xs:restriction> > </xs:simpleType> > > If you can positively assert the values it is allowed to > have, that might be simpler. > > Cheers > > //Mary > From mike@s... Fri Apr 21 08:09:56 2006 Received: from aji.w3.org ([133.27.228.225]) by f | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
