Visualizzazione dei risultati da 1 a 3 su 3

Discussione: XML Schema

  1. #1
    Utente di HTML.it L'avatar di Angelo1974
    Registrato dal
    Feb 2003
    Messaggi
    1,107

    XML Schema

    Ciao a tutti; supponiamo io abbia un file XML in cui ci debba essere almeno uno degli elementi nome, cognome e dataNascita.... come posso indicarlo in uno schema?
    Cioè vorrei che lo schema indicasse che almeno uno di questi tre deve esse presente... è possibile?
    Grazie e ciao
    Se vuoi trovare l'arcobaleno, devi sopportare la pioggia

  2. #2
    Utente di HTML.it L'avatar di Cheope
    Registrato dal
    Dec 2003
    Messaggi
    327
    Suppongo che tu debba imparare a fare gli schemi...
    Puoi iniziare da qui:

    http://pro.html.it/articoli/id_175/idcat_33/pro.html

    http://www.w3schools.com/xml/default.asp

    /* Let's Lead the Web to Its Full Potential */

  3. #3
    Utente di HTML.it L'avatar di Angelo1974
    Registrato dal
    Feb 2003
    Messaggi
    1,107
    Grazie della risposta... diciamo che per quanto riguarda i link che mi hai dato li conosco abbastanza bene e non mi dicono nulla in merito a quello che mi interessa circa gli schema; io ho questo schema:

    codice:
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:simpleType name="codiceIndividuo">
            <xsd:restriction base="xsd:string">
                <xsd:whiteSpace value="collapse"/>
                <xsd:pattern value="[0-9]{10}"/>
            </xsd:restriction>
        </xsd:simpleType>
        <xsd:simpleType name="codiceFamiglia">
            <xsd:restriction base="xsd:string">
                <xsd:whiteSpace value="collapse"/>
                <xsd:pattern value="[0-9a-zA-Z]{2,10}"/>
            </xsd:restriction>
        </xsd:simpleType>
        <xsd:simpleType name="cognome">
            <xsd:restriction base="xsd:string">
                <xsd:whiteSpace value="collapse"/>
                <xsd:pattern value="[a-zA-Z0-9]{2,50}"/>
            </xsd:restriction>
        </xsd:simpleType>
        <xsd:simpleType name="nome">
            <xsd:restriction base="xsd:string">
                <xsd:whiteSpace value="collapse"/>
                <xsd:pattern value="[0-9A-Za-z]{2,50}"/>
            </xsd:restriction>
        </xsd:simpleType>
        <xsd:simpleType name="dataNascita">
            <xsd:restriction base="xsd:date"/>
        </xsd:simpleType>
        <xsd:simpleType name="sesso">
            <xsd:restriction base="xsd:string">
                <xsd:whiteSpace value="collapse"/>
                <xsd:pattern value="[mfMF]{1}"/>
            </xsd:restriction>
        </xsd:simpleType>
        <xsd:complexType name="comuneNascita">
            <xsd:sequence>
                <xsd:element name="codIstat" type="xsd:string"/>
                <xsd:element name="descrizione" type="xsd:string"/>
            </xsd:sequence>
        </xsd:complexType>
        <xsd:simpleType name="siglaProvNascita">
            <xsd:restriction base="xsd:string"/>
        </xsd:simpleType>
        <xsd:simpleType name="statoCivile">
            <xsd:restriction base="xsd:string"/>
        </xsd:simpleType>
        <xsd:simpleType name="gradoParentela">
            <xsd:restriction base="xsd:string"/>
        </xsd:simpleType>
        <xsd:simpleType name="statoIndividuo">
            <xsd:restriction base="xsd:string"/>
        </xsd:simpleType>
        <xsd:complexType name="toponomastica">
            <xsd:sequence>
                <xsd:element name="toponimo" type="xsd:string"/>
                <xsd:element name="descrizioneVia" type="xsd:string"/>
                <xsd:element name="numeroCivico" type="xsd:string"/>
                <xsd:element name="scala" type="xsd:string"/>
                <xsd:element name="lettera" type="xsd:string"/>
                <xsd:element name="interno" type="xsd:string"/>
                <xsd:element name="piano" type="xsd:string"/>
                <xsd:element name="lotto" type="xsd:string"/>
                <xsd:element name="isolato" type="xsd:string"/>
                <xsd:element name="codiceQuartiere" type="xsd:string"/>
                <xsd:element name="descrizioneQuartiere" type="xsd:string"/>
                <xsd:element name="codiceVia" type="xsd:string"/>
                <xsd:element name="km" type="xsd:string"/>
                <xsd:element name="cap" type="xsd:string"/>
                <xsd:element name="capVia" type="xsd:string"/>
                <xsd:element name="codIstatComune" minOccurs="0" type="xsd:string"/>
            </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="paternita">
            <xsd:sequence>
                <xsd:element name="cognome" type="xsd:string"/>
                <xsd:element name="nome" type="xsd:string"/>
            </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="maternita">
            <xsd:sequence>
                <xsd:element name="nome" type="xsd:string"/>
                <xsd:element name="cognome" type="xsd:string"/>
            </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="attoNascita">
            <xsd:sequence>
                <xsd:element name="numero" type="xsd:string"/>
                <xsd:element name="anno" type="xsd:string"/>
                <xsd:element name="parte" type="xsd:string"/>
                <xsd:element name="serie" type="xsd:string"/>
                <xsd:element name="ufficio" type="xsd:string"/>
            </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="attoNascitaTrascritto">
            <xsd:sequence>
                <xsd:element name="descrizioneComuneTrascrizione" type="xsd:string"/>
                <xsd:element name="numero" type="xsd:string"/>
                <xsd:element name="anno" type="xsd:string"/>
                <xsd:element name="parte" type="xsd:string"/>
                <xsd:element name="serie" type="xsd:string"/>
                <xsd:element name="ufficio" type="xsd:string"/>
            </xsd:sequence>
        </xsd:complexType>
        <xsd:simpleType name="descrizioneStatoCivile">
            <xsd:restriction base="xsd:string"/>
        </xsd:simpleType>
        <xsd:complexType name="coniuge">
            <xsd:sequence>
                <xsd:element name="nome" type="xsd:string"/>
                <xsd:element name="cognome" type="xsd:string"/>
            </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="matrimonio">
            <xsd:sequence>
                <xsd:element name="data" type="xsd:date"/>
                <xsd:element name="descrizioneComune" type="xsd:string"/>
            </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="attoMatrimonio">
            <xsd:sequence>
                <xsd:element name="numero" type="xsd:string"/>
                <xsd:element name="parte" type="xsd:string"/>
                <xsd:element name="serie" type="xsd:string"/>
                <xsd:element name="ufficio" type="xsd:string"/>
                <xsd:element name="anno" type="xsd:string"/>
            </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="attoTrascrittoMatrimonio">
            <xsd:sequence>
                <xsd:element name="numero" type="xsd:string"/>
                <xsd:element name="parte" type="xsd:string"/>
                <xsd:element name="serie" type="xsd:string"/>
                <xsd:element name="ufficio" type="xsd:string"/>
                <xsd:element name="anno" type="xsd:string"/>
                <xsd:element name="descrizioneComune" type="xsd:string"/>
            </xsd:sequence>
        </xsd:complexType>
        <xsd:simpleType name="stringaUltimaImmigrazione">
            <xsd:restriction base="xsd:string"/>
        </xsd:simpleType>
        <xsd:simpleType name="stringaUltimaEmigrazione">
            <xsd:restriction base="xsd:string"/>
        </xsd:simpleType>
        <xsd:simpleType name="cittadinanaza">
            <xsd:restriction base="xsd:string"/>
        </xsd:simpleType>
        <xsd:simpleType name="codiceFiscale">
            <xsd:restriction base="xsd:string">
                <xsd:whiteSpace value="collapse"/>
                <xsd:pattern value="[0-9a-zA-Z]{16}"/>
            </xsd:restriction>
        </xsd:simpleType>
        <xsd:element name="outputVisura">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="globale" type="globale"/>
                    <xsd:element name="datiUtente" minOccurs="0" type="datiUtente"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:complexType name="globale">
            <xsd:sequence>
                <xsd:element name="esitoRicerca" type="xsd:string"/>
                <xsd:element name="descrizioneRicerca" type="xsd:string"/>
                <xsd:element name="dataSistema" type="xsd:date"/>
            </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="datiUtente">
            <xsd:sequence>
                <xsd:element name="codiceIndividuo" type="codiceIndividuo"/>
                <xsd:element name="codiceFamiglia" type="codiceFamiglia"/>
                <xsd:element name="cognome" type="cognome"/>
                <xsd:element name="nome" type="nome"/>
                <xsd:element name="dataNascita" type="dataNascita"/>
                <xsd:element name="sesso" type="sesso"/>
                <xsd:element name="comuneNascita" type="comuneNascita"/>
                <xsd:element name="siglaProvinciaNascita" type="siglaProvNascita"/>
                <xsd:element name="statoCivile" type="statoCivile"/>
                <xsd:element name="gradoParentela" type="gradoParentela"/>
                <xsd:element name="statoIndividuo" type="statoIndividuo"/>
                <xsd:element name="toponomastica" type="toponomastica"/>
                <xsd:element name="paternita" type="paternita"/>
                <xsd:element name="maternita" type="maternita"/>
                <xsd:element name="attoNascita" type="attoNascita"/>
                <xsd:element name="attoNascitaTrascritto" type="attoNascitaTrascritto"/>
                <xsd:element name="descrizioneStatoCivile" type="descrizioneStatoCivile"/>
                <xsd:element name="coniuge" type="coniuge"/>
                <xsd:element name="matrimonio" type="matrimonio"/>
                <xsd:element name="attoMatrimonio" type="attoMatrimonio"/>
                <xsd:element name="attoTrascrittoMatrimonio" type="attoTrascrittoMatrimonio"/>
                <xsd:element name="stringaUltimaImmigrazione" type="stringaUltimaImmigrazione"/>
                <xsd:element name="stringaUltimaEmigrazione" type="stringaUltimaEmigrazione"/>
                <xsd:element name="cittadinanza" type="cittadinanaza"/>
                <xsd:element name="codiceFiscale" type="codiceFiscale"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:schema>
    Come faccio a fargli capire che in toponomastice almeno 1 dei quattro deve essere presente e non nullo?
    Grazie
    Se vuoi trovare l'arcobaleno, devi sopportare la pioggia

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.