Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


AW: Restricting attribute content to not include a specific string

From: "Huditsch, Roman \(LNG-VIE\)" <Roman.Huditsch@----------.-->
To: <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


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent