A
apolloj
Hi,
I've got this xsd schema :
1/ info.xsd :
<?xml version="1.0" encoding="utf8" ?>
<xsd:schema xmlns=""
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="">
<xsd:element name="description" type="xsd:string"/>
<xsd:element name="services-test" type="xsd:string"/>
<!-- definition du noeud racine 'services-test' -->
<xsd:complexType name="services-test">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="mat"
type="mat"/>
</xsd:sequence>
<xsd:attribute name="noNamespaceSchemaLocation" type="xsd:token"/>
</xsd:complexType>
<!-- definition du noeud 'mat' -->
<xsd:complexType name="mat">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="description"
type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="1" name="contrats"
type="contrats"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:token" use="required"/>
</xsd:complexType>
<!-- defintion du noeud 'contrats'-->
<xsd:complexType name="contrats">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="contrat"
type="contrat"/>
</xsd:sequence>
</xsd:complexType>
<!-- validation du noeud 'contrat' -->
<xsd:complexType name="contrat">
<xsd:sequence>
<xsd:element name="description" type="xsd:string"/>
<xsd:element name="etatContrat" type="etatContrat"/>
<xsd:element name="services" type="services"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:token"/>
</xsd:complexType>
<!-- Validation de noeud 'EtatContrat' -->
<xsd:complexType name="etatContrat">
<xsd:sequence>
<xsd:element name="etat" type="etat"/>
</xsd:sequence>
<xsd:attribute name="dateEffet" type="xsd:string" use="optional"/>
</xsd:complexType>
<xsd:complexType name="etat">
<xsd:sequence>
<xsd:element name="description" type="xsd:token"/>
</xsd:sequence>
<xsd:attribute name="name" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="test:etatContratrevu"/>
<xsd:enumeration value="test:etatContratperationnel"/>
<xsd:enumeration value="test:etatContrat:stabilise"/>
<xsd:enumeration value="test:etatContratbsolescent"/>
<xsd:enumeration value="test:etatContrat:retire"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="services">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="service"
type="service"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="service">
<xsd:sequence>
<xsd:element name="description" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="accessPoint" type="xsd:anyURI"/>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="wsdl" type="xsd:anyURI" use="required" />
</xsd:complexType>
</xsd:schema>
2/ This info.xml file :
<?xml version="1.0" encoding="utf8"?>
<services-test>
<mat name="MAN">
<description>mat</description>
<contrats>
<contrat name="CONTRAT_MAN_top2">
<description>contrat CONTRAT_MAN_top2</description>
<etatContrat>
<etat name=":etatContrat:stabilise">
<description>Stabilisé</description>
</etat>
</etatContrat>
<services>
<service name="RestitutionNomenclatureInterface"
wsdl="http://192.168.31.32:1511/mannaf_CA2_Z2/services/MAN/contrat_naf">
accessPoint="http://192.168.31.32:1511/mannaf_CA2_Z2/services/MAN/contrat_naf">
<description>Description</description>
</service>
<service name="RestitutionActivitesInterface"
wsdl="http://192.168.31.32:1511/mannaf_CA2_Z2/services/MAN/contrat_naf"
accessPoint="http://192.168.31.32:1511/mannaf_CA2_Z2/services/MAN/contrat_naf">
<description>Description</description>
</service>
</services>
</contrat>
</contrats>
</mat>
</services-test>
3/ When I try to validate info.xml againt info.xsd, I've got this error :
xmllint --noout --schema ./info.xsd ./info.xml
../info.xml:1: element services-test: Schemas validity error : Element
'services-test': No matching global declaration available.
../info.xml fails to validate
What do I miss ?
Thanks in advance.
I've got this xsd schema :
1/ info.xsd :
<?xml version="1.0" encoding="utf8" ?>
<xsd:schema xmlns=""
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="">
<xsd:element name="description" type="xsd:string"/>
<xsd:element name="services-test" type="xsd:string"/>
<!-- definition du noeud racine 'services-test' -->
<xsd:complexType name="services-test">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="mat"
type="mat"/>
</xsd:sequence>
<xsd:attribute name="noNamespaceSchemaLocation" type="xsd:token"/>
</xsd:complexType>
<!-- definition du noeud 'mat' -->
<xsd:complexType name="mat">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="description"
type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="1" name="contrats"
type="contrats"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:token" use="required"/>
</xsd:complexType>
<!-- defintion du noeud 'contrats'-->
<xsd:complexType name="contrats">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="contrat"
type="contrat"/>
</xsd:sequence>
</xsd:complexType>
<!-- validation du noeud 'contrat' -->
<xsd:complexType name="contrat">
<xsd:sequence>
<xsd:element name="description" type="xsd:string"/>
<xsd:element name="etatContrat" type="etatContrat"/>
<xsd:element name="services" type="services"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:token"/>
</xsd:complexType>
<!-- Validation de noeud 'EtatContrat' -->
<xsd:complexType name="etatContrat">
<xsd:sequence>
<xsd:element name="etat" type="etat"/>
</xsd:sequence>
<xsd:attribute name="dateEffet" type="xsd:string" use="optional"/>
</xsd:complexType>
<xsd:complexType name="etat">
<xsd:sequence>
<xsd:element name="description" type="xsd:token"/>
</xsd:sequence>
<xsd:attribute name="name" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="test:etatContratrevu"/>
<xsd:enumeration value="test:etatContratperationnel"/>
<xsd:enumeration value="test:etatContrat:stabilise"/>
<xsd:enumeration value="test:etatContratbsolescent"/>
<xsd:enumeration value="test:etatContrat:retire"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="services">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="service"
type="service"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="service">
<xsd:sequence>
<xsd:element name="description" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="accessPoint" type="xsd:anyURI"/>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="wsdl" type="xsd:anyURI" use="required" />
</xsd:complexType>
</xsd:schema>
2/ This info.xml file :
<?xml version="1.0" encoding="utf8"?>
<services-test>
<mat name="MAN">
<description>mat</description>
<contrats>
<contrat name="CONTRAT_MAN_top2">
<description>contrat CONTRAT_MAN_top2</description>
<etatContrat>
<etat name=":etatContrat:stabilise">
<description>Stabilisé</description>
</etat>
</etatContrat>
<services>
<service name="RestitutionNomenclatureInterface"
wsdl="http://192.168.31.32:1511/mannaf_CA2_Z2/services/MAN/contrat_naf">
accessPoint="http://192.168.31.32:1511/mannaf_CA2_Z2/services/MAN/contrat_naf">
<description>Description</description>
</service>
<service name="RestitutionActivitesInterface"
wsdl="http://192.168.31.32:1511/mannaf_CA2_Z2/services/MAN/contrat_naf"
accessPoint="http://192.168.31.32:1511/mannaf_CA2_Z2/services/MAN/contrat_naf">
<description>Description</description>
</service>
</services>
</contrat>
</contrats>
</mat>
</services-test>
3/ When I try to validate info.xml againt info.xsd, I've got this error :
xmllint --noout --schema ./info.xsd ./info.xml
../info.xml:1: element services-test: Schemas validity error : Element
'services-test': No matching global declaration available.
../info.xml fails to validate
What do I miss ?
Thanks in advance.