PDA

View Full Version : xml schema


texerasmo
26-03-2003, 12:03
Ciao ragazzi ,
Non riesco ha creare un un tag nello schema di xml che identifichi il campo email

<xs:simpleType name="Posta">
<xs:restriction base="xs:string">
<xs:pattern value="\d{1}@\d[A-Z]{2,10}.\d{2,4}"></xs:pattern>
</xs:restriction>
</xs:simpleType>
Potete aiutarmi?

texerasmo
27-03-2003, 11:26
ho trovato la soluzione :
:D

<xs:simpleType name="emailType">
<xs:restriction base="xs:string">
<xs:pattern value="[\p{L}_-]+(\.[\p{L}_-]+)*@[\p{L}_]+(\.[\p{L}_]+)+"/>
</xs:restriction>
</xs:simpleType>

Oppure anche cosė sembra che funzioni

<xs:simpleType name="Posta">
<xs:restriction base="xs:string">
<xs:pattern value="(.*)@(.*)\.[A-Z]+"/>
</xs:restriction>
</xs:simpleType>

Per questi casi vi consiglio di vedere la sintassi di:

Regular Expressions

Ciao