IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Valider XML Discussion :

[xsd][xerces] Cannot find the declaration of element 'news'


Sujet :

Valider XML

  1. #1
    Candidat au Club
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Avril 2006
    Messages : 5
    Points : 2
    Points
    2
    Par défaut [xsd][xerces] Cannot find the declaration of element 'news'
    Bonjour, j'obtiens toujours le même problème quand je tente de valider mon fichier xml.

    Voici le schema :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    	<!-- =========================================================================== -->
    	<!-- News definitions -->
    	<!-- =========================================================================== -->
    	<xs:element name="news">
    		<xs:complexType>
    			<xs:sequence>
    				<xs:element name="id" type="xs:string"/>
    				<xs:element ref="publisher"/>
    				<xs:element ref="publish_date"/>
    				<xs:element name="expiration" default="PERMANENT" minOccurs="0">
    					<xs:complexType>
    						<xs:simpleContent>
    							<xs:extension base="xs:string">
    								<xs:attribute name="type" type="xs:string" use="required"/>
    							</xs:extension>
    						</xs:simpleContent>
    					</xs:complexType>
    				</xs:element>
    				<xs:element ref="press_release_number" minOccurs="0"/>
    				<xs:element ref="file_ref" minOccurs="0"/>
    				<xs:element ref="vwn"/>
    				<xs:element name="lang_sections">
    					<xs:annotation>
    						<xs:documentation>Translated sections</xs:documentation>
    					</xs:annotation>
    					<xs:complexType>
    						<xs:sequence maxOccurs="25">
    							<xs:element name="lang_section">
    								<xs:complexType>
    									<xs:sequence>
    										<xs:element ref="file_ref" minOccurs="0"/>
    										<xs:element ref="display_name"/>
    										<xs:element ref="description" minOccurs="0"/>
    										<xs:element ref="place" minOccurs="0"/>
    										<xs:element ref="report_url" minOccurs="0"/>
    									</xs:sequence>
    									<xs:attribute name="meta_language" type="st_eu_language" use="required"/>
    								</xs:complexType>
    							</xs:element>
    						</xs:sequence>
    					</xs:complexType>
    				</xs:element>
    			</xs:sequence>
    		</xs:complexType>
    	</xs:element>
    	<!-- =========================================================================== -->
    	<!-- News attributes -->
    	<!-- =========================================================================== -->
    	<xs:simpleType name="st_eu_language">
    		<xs:annotation>
    			<xs:documentation>
    bg - bălgarski
    es - español
    cs - čeština 
    da - dansk 
    de - Deutsch
    et - eesti keel 
    el - elliniká 
    en - English 
    fr - français
    ga - Gaeilge
    [hr - hrvatski]
    it - italiano 
    lv - latviešu valoda 
    lt - lietuvių kalba
    hu - magyar 
    mt - Malti 
    nl - Nederlands 
    pl - polski 
    pt - português 
    ro - română 
    sk - slovenčina 
    sl - slovenščina
    fi - suomi 
    sv - svenska 
    [tr - türkçe]
    </xs:documentation>
    		</xs:annotation>
    		<xs:restriction base="xs:NMTOKEN">
    			<xs:enumeration value="bg"/>
    			<xs:enumeration value="es"/>
    			<xs:enumeration value="cs"/>
    			<xs:enumeration value="da"/>
    			<xs:enumeration value="de"/>
    			<xs:enumeration value="et"/>
    			<xs:enumeration value="el"/>
    			<xs:enumeration value="en"/>
    			<xs:enumeration value="fr"/>
    			<xs:enumeration value="ga"/>
    			<xs:enumeration value="hr"/>
    			<xs:enumeration value="it"/>
    			<xs:enumeration value="lv"/>
    			<xs:enumeration value="lt"/>
    			<xs:enumeration value="hu"/>
    			<xs:enumeration value="mt"/>
    			<xs:enumeration value="nl"/>
    			<xs:enumeration value="pl"/>
    			<xs:enumeration value="pt"/>
    			<xs:enumeration value="ro"/>
    			<xs:enumeration value="sk"/>
    			<xs:enumeration value="sl"/>
    			<xs:enumeration value="fi"/>
    			<xs:enumeration value="sv"/>
    			<xs:enumeration value="tr"/>
    		</xs:restriction>
    	</xs:simpleType>
    	<xs:element name="eu_language" type="st_eu_language"/>
    	<xs:element name="vwn" type="xs:boolean"/>
    	<xs:element name="publisher">
    		<xs:simpleType>
    			<xs:restriction base="xs:string">
    				<xs:enumeration value="ECA"/>
    				<xs:enumeration value="EUROPA"/>
    				<xs:enumeration value="INTOSAI"/>
    				<xs:enumeration value="EUROSAI"/>
    				<xs:enumeration value="SIGMA"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="press_release_number">
    		<xs:simpleType>
    			<xs:restriction base="xs:string">
    				<xs:pattern value="ECA/[a-zA-Z0-9]{2}/[a-zA-Z0-9]{2}"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="file_ref">
    		<xs:simpleType>
    			<xs:restriction base="xs:string">
    				<xs:maxLength value="256"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="display_name">
    		<xs:simpleType>
    			<xs:restriction base="xs:string">
    				<xs:maxLength value="150"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="description">
    		<xs:simpleType>
    			<xs:restriction base="xs:string"/>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="place">
    		<xs:simpleType>
    			<xs:restriction base="xs:string">
    				<xs:maxLength value="200"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="report_url">
    		<xs:simpleType>
    			<xs:restriction base="xs:string">
    				<xs:maxLength value="256"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="publish_date">
    		<xs:annotation>
    			<xs:documentation>DD/MM/YYYY HH24:MI</xs:documentation>
    		</xs:annotation>
    		<xs:simpleType>
    			<xs:restriction base="xs:string">
    				<xs:pattern value="\d{2}/\d{2}/\d{4} \d{2}:\d{2}"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<!-- ================================================================ 
    	<xs:element name="expiration_date">
    		<xs:annotation>
    			<xs:documentation>DD/MM/YYYY HH24:MI</xs:documentation>
    		</xs:annotation>
    		<xs:simpleType>
    			<xs:restriction base="xs:string">
    				<xs:pattern value="\d{2}/\d{2}/\d{4} \d{2}:\d{2}"/>
    			</xs:restriction>
    		</xs:simpleType>
    	</xs:element>
    	<xs:element name="expiration_days">
    		<xs:annotation>
    			<xs:documentation>Number of days</xs:documentation>
    		</xs:annotation>
    		<xs:simpleType>
    			<xs:restriction base="xs:positiveInteger"/>
    		</xs:simpleType>
    	</xs:element>-->
    </xs:schema>
    Et voici un exemple de fichier xml :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
     
    <?xml version="1.0" encoding="UTF-8"?>
    <news xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\Documents and Settings\pironbe\Mes documents\items.xsd">
    	<id>68</id>
    	<publisher>ECA</publisher>
    	<publish_date>04/10/2006 13:52</publish_date>
    	<vwn>true</vwn>
    	<lang_sections>
    		<lang_section meta_language="en">
    			<display_name>test</display_name>
    			<description><![CDATA[test]]></description>
    		</lang_section>
    	</lang_sections>
    </news>
    Le code d'erreur est :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    cvc-elt.1: Cannot find the declaration of element 'news'.

    Merci de votre aide,

    Benoit

  2. #2
    Expert éminent
    Avatar de GrandFather
    Inscrit en
    Mai 2004
    Messages
    4 587
    Détails du profil
    Informations personnelles :
    Âge : 54

    Informations forums :
    Inscription : Mai 2004
    Messages : 4 587
    Points : 7 103
    Points
    7 103
    Par défaut
    Bonjour,

    quel validateur de schéma utilises-tu, MSXML ?
    FAQ XML
    ------------
    « Le moyen le plus sûr de cacher aux autres les limites de son savoir est de ne jamais les dépasser »
    Giacomo Leopardi

  3. #3
    Candidat au Club
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Avril 2006
    Messages : 5
    Points : 2
    Points
    2
    Par défaut
    xerces en version 2_6_2 (le jar se nomme : Xerces-J-bin.2.6.2.tar)

    J'espère que vous pourrez m'aider :-)

  4. #4
    Candidat au Club
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Avril 2006
    Messages : 5
    Points : 2
    Points
    2
    Par défaut
    Personne n'a d'idée ?

  5. #5
    Candidat au Club
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Avril 2006
    Messages : 5
    Points : 2
    Points
    2
    Par défaut
    Je continue mes recherches et je pense que c'est certainement un problème de namespace ou quelque chose comme celà, mais je n'y connais pas grand chose, j'ai testé avec un validateur en ligne, et voici les erreurs :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    Validation error: Warning at (2,2): Could not find schema information for the element 'news'.
      Warning at (3,4): Could not find schema information for the element 'id'.
    19  Warning at (4,4): Could not find schema information for the element 'publisher'.
    ECA  Warning at (5,4): Could not find schema information for the element 'publish_date'.
    04/05/2006 11:17  Warning at (6,4): Could not find schema information for the element 'expiration'.
    04/15/2006 11:21  Warning at (7,4): Could not find schema information for the element 'press_release_number'.
    ECA/23/23  Warning at (8,4): Could not find schema information for the element 'file_ref'.
    24208.JPG  Warning at (9,4): Could not find schema information for the element 'vwn'.
    true  Warning at (10,4): Could not find schema information for the element 'lang_sections'.
        Warning at (11,6): Could not find schema information for the element 'lang_section'.
    Warning at (11,19): Could not find schema information for the attribute 'meta_language'.
          Warning at (12,8): Could not find schema information for the element 'file_ref'.
    24209.JAVA      Warning at (13,8): Could not find schema information for the element 'display_name'.
    Oracle Portal Test News      Warning at (14,8): Could not find schema information for the element 'description'.
    This is a test news !
    This is a test news !This is a [FONT=Courier New]test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news !This is a test news[/FONT] !This is a test news !This is a test news !This is a test news !This is a test news !
     
    ]]>      Warning at (15,8): Could not find schema information for the element 'place'.
    Strassen      Warning at (16,8): Could not find schema information for the element 'report_url'.
    http://www.google.be/        Warning at (18,6): Could not find schema information for the element 'lang_section'.
    Warning at (18,19): Could not find schema information for the attribute 'meta_language'.
          Warning at (19,8): Could not find schema information for the element 'file_ref'.
    24210.PDF      Warning at (20,8): Could not find schema information for the element 'display_name'.
    Nouvelle de test Oracle      Warning at (21,8): Could not find schema information for the element 'description'.
    Ceci est une nouvelle de test &eacute;-&agrave;-&ccedil; !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !Ceci est une nouvelle de test !
    ]]>      Warning at (22,8): Could not find schema information for the element 'place'.
    Strassen      Warning at (23,8): Could not find schema information for the element 'report_url'.
    http://www.google.lu/        Warning at (25,6): Could not find schema information for the element 'lang_section'.
    Warning at (25,19): Could not find schema information for the attribute 'meta_language'.
          Warning at (26,8): Could not find schema information for the element 'file_ref'.
    24211.JPG      Warning at (27,8): Could not find schema information for the element 'display_name'.
    Türkçe news      Warning at (28,8): Could not find schema information for the element 'description'.
    This is a T&uuml;rk&ccedil;e newsбългарски ( bg )
    български ( bg )
    български ( bg )
    български ( bg )
    български ( bg )
    [FONT=Verdana]български ( bg )[/FONT]
    български ( bg )
    български ( bg )
    български ( bg )
    български ( bg )
    български ( bg )
    </p>Finit !
    ]]>      Warning at (29,8): Could not find schema information for the element 'place'.
    Istanbul      Warning at (30,8): Could not find schema information for the element 'report_url'.
    http://www.google.tu/

Discussions similaires

  1. cvc-elt.1: Cannot find the declaration of element
    Par jbelis dans le forum Format d'échange (XML, JSON...)
    Réponses: 0
    Dernier message: 15/02/2011, 13h12
  2. [JAXB] XmlRootElement & Cannot find the declaration of element ...
    Par ZuZu dans le forum Format d'échange (XML, JSON...)
    Réponses: 0
    Dernier message: 13/10/2010, 11h21
  3. Réponses: 1
    Dernier message: 27/08/2010, 14h10
  4. [JAXB] Cannot find the declaration of element
    Par thomas.huguerre dans le forum Persistance des données
    Réponses: 1
    Dernier message: 23/06/2009, 18h16
  5. [DOM] Sax Exception: 'cvc-elt.1: Cannot find the declaration of element 'site:blog'
    Par laurent_m dans le forum Format d'échange (XML, JSON...)
    Réponses: 5
    Dernier message: 05/03/2009, 22h52

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo