[Xmldb-org-xupdate] Re: Xupdate XSD
Brought to you by:
reinhapa
|
From: Isidro V. V. <jv...@se...> - 2005-08-19 13:43:58
|
Hi Kasimier, It seems that Libmxl2 don't have full support for XML Schema, but I = change the XSD a little bit to workaround with this Libxml2 limitation. The second version is here: ----------------------- <?xml version=3D"1.0" encoding=3D"UTF-8"?> <xs:schema targetNamespace=3D"http://www.xmldb.org/xupdate" xmlns:xs=3D"http://www.w3.org/2001/XMLSchema" xmlns:xupdate=3D"http://www.xmldb.org/xupdate" = elementFormDefault=3D"qualified" attributeFormDefault=3D"unqualified"> <xs:annotation> <xs:appinfo>xsd4xupdate</xs:appinfo> <xs:documentation>A XSD for Xupdate</xs:documentation> </xs:annotation> <xs:group name=3D"modifications"> <xs:choice> <xs:element ref=3D"xupdate:insert-before"/> <xs:element ref=3D"xupdate:insert-after"/> <xs:element ref=3D"xupdate:append"/> <xs:element ref=3D"xupdate:update"/> <xs:element ref=3D"xupdate:remove"/> <xs:element ref=3D"xupdate:rename"/> <xs:element ref=3D"xupdate:variable"/> <xs:element ref=3D"xupdate:value-of"/> <xs:element ref=3D"xupdate:if"/> </xs:choice> </xs:group> <xs:element name=3D"modifications"> <xs:complexType> <xs:sequence> <xs:group ref=3D"xupdate:modifications" minOccurs=3D"0" maxOccurs=3D"unbounded"/> </xs:sequence> <xs:attribute name=3D"id" type=3D"xs:ID" use=3D"optional"/> <xs:attribute name=3D"version" type=3D"xs:NMTOKEN" use=3D"required" fixed=3D"1.0"/> </xs:complexType> </xs:element> <xs:group name=3D"instructions"> <xs:choice> <xs:element ref=3D"xupdate:element"/> <xs:element ref=3D"xupdate:attribute"/> <xs:element ref=3D"xupdate:text"/> <xs:element ref=3D"xupdate:processing-instruction"/> <xs:element ref=3D"xupdate:comment"/> <xs:element ref=3D"xupdate:value-of"/> <xs:element ref=3D"xupdate:if"/> <xs:element ref=3D"xupdate:variable"/> <xs:element ref=3D"xupdate:cdata"/> </xs:choice> </xs:group> <xs:element name=3D"insert-before"> <xs:complexType> <xs:group ref=3D"xupdate:instructions" maxOccurs=3D"unbounded"/> <xs:attribute name=3D"select" type=3D"xs:string" use=3D"required"/> </xs:complexType> </xs:element> <xs:element name=3D"insert-after"> <xs:complexType> <xs:group ref=3D"xupdate:instructions"/> <xs:attribute name=3D"select" type=3D"xs:string" use=3D"required"/> </xs:complexType> </xs:element> <xs:element name=3D"append"> <xs:complexType> <xs:group ref=3D"xupdate:instructions"/> <xs:attribute name=3D"select" type=3D"xs:string" use=3D"required"/> <xs:attribute name=3D"child" type=3D"xs:string" use=3D"optional"/> </xs:complexType> </xs:element> <xs:element name=3D"update"> <xs:complexType mixed=3D"true"> <xs:sequence> <xs:any namespace=3D"##other" processContents=3D"lax" minOccurs=3D"0" maxOccurs=3D"unbounded"/> </xs:sequence> <xs:attribute name=3D"select" type=3D"xs:string" use=3D"required"/> </xs:complexType> </xs:element> <xs:element name=3D"remove"> <xs:complexType> <xs:attribute name=3D"select" type=3D"xs:string" use=3D"required"/> </xs:complexType> </xs:element> <xs:element name=3D"rename"> <xs:complexType> <xs:simpleContent> <xs:extension base=3D"xs:NMTOKEN"> <xs:attribute name=3D"select" type=3D"xs:string" use=3D"required"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name=3D"variable"> <xs:complexType> <xs:simpleContent> <xs:extension base=3D"xs:string"> <xs:attribute name=3D"name" type=3D"xs:NMTOKEN" use=3D"required"/> <xs:attribute name=3D"select" type=3D"xs:string" use=3D"optional"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name=3D"value-of"> <xs:complexType> <xs:attribute name=3D"select" type=3D"xs:string" use=3D"required"/> </xs:complexType> </xs:element> <xs:element name=3D"if"> <xs:complexType mixed=3D"true"> <xs:group ref=3D"xupdate:instructions"/> <xs:attribute name=3D"test" type=3D"xs:string" use=3D"required"/> </xs:complexType> </xs:element> <!-- - --> <xs:element name=3D"element"> <xs:complexType mixed=3D"true"> <xs:sequence> <xs:group ref=3D"xupdate:instructions" minOccurs=3D"0"/> <xs:any namespace=3D"##other" processContents=3D"lax" minOccurs=3D"0" maxOccurs=3D"unbounded"/> </xs:sequence> <xs:attribute name=3D"name" type=3D"xs:NMTOKEN" use=3D"required"/> <xs:attribute name=3D"namespace" type=3D"xs:QName" use=3D"optional"/> </xs:complexType> </xs:element> <xs:element name=3D"attribute"> <xs:complexType> <xs:simpleContent> <xs:extension base=3D"xs:string"> <xs:attribute name=3D"name" type=3D"xs:NMTOKEN" use=3D"required"/> <xs:attribute name=3D"namespace" type=3D"xs:string" use=3D"optional"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name=3D"text" type=3D"xs:string"/> <xs:element name=3D"comment" type=3D"xs:string"/> <xs:element name=3D"processing-instruction"> <xs:complexType> <xs:simpleContent> <xs:extension base=3D"xs:string"> <xs:attribute name=3D"name" type=3D"xs:NMTOKEN" use=3D"required"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name=3D"cdata" type=3D"xs:string"/> </xs:schema> ----------------------- From: Kasimier Buchcik <kbuchcik@4c...> Re: Xupdate XSD =A0=20 2005-08-17 02:17=20 Hi, =20 (this is a handmade reply to the mail from Lars Martin, since I just subscribed) =20 Occurences must not be specified on the model group child of model group definitions. =20 With Libxml2 I get: =20 xmllint --noout --schema XUpdate.xsd xudummy.xml =20 XUpdate.xsd:44: element choice: Schemas parser error : Element "{http://www.w3.org/2001/XMLSchema}choice": The attribute "minOccurs" is not allowed. XUpdate.xsd:44: element choice: Schemas parser error : Element "{http://www.w3.org/2001/XMLSchema}choice": The attribute "maxOccurs" is not allowed. WXS schema XUpdate.xsd failed to compile =20 The occurences need to be moved to each of the model group references. =20 Regards, =20 Kasimier Isidro Vila Verde email: jv...@se...=20 web: http://serprest.pt/ ------------------------------------------ Este e-mail pode conter informa=E7=E3o confidencial e/ou privilegiada. = Se n=E3o for o destinat=E1rio pretendido (ou receber este e-mail por erro), = apague de imediato esta mensagem e por gentileza notifique o remetente. Toda a c=F3pia, divulga=E7=E3o ou distribui=E7=E3o n=E3o autorizada do = material deste e-mail =E9 estritamente proibida. ------------------------------------------ This e-mail may contain confidential and/or privileged information. If = you are not the intended recipient (or have received this e-mail in error) destroy this e-mail immediately and please notify the sender. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. ------------------------------------------ --=20 No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.10.12/77 - Release Date: = 18-08-2005 =20 |