[wpkg-users] Error in profiles.xsd
While finishing up some schema validation stuff for wpkgExpress, I noticed an error in profiles.xsd: 22 xsd:complexType name=profile snip 26 xsd:sequence 27 xsd:choice minOccurs=0 maxOccurs=unbounded 28 xsd:element ref=package 29 xsd:annotation 30 xsd:documentationAssigns a package to the profile./xsd:documentation 31 /xsd:annotation/xsd:element 32 /xsd:choice 33 xsd:choice minOccurs=0 maxOccurs=unbounded 34 xsd:element ref=depends 35 xsd:annotation 36 xsd:documentationDependency definition. Allows to refer to another profile which is included./xsd:documentation 37 /xsd:annotation/xsd:element 38 xsd:element ref=variable 39 xsd:annotation 40 xsd:documentationVariable definition./xsd:documentation 41 /xsd:annotation/xsd:element 42 /xsd:choice 43 /xsd:sequence snip 50 /xsd:complexType should be: 22 xsd:complexType name=profile snip 26 xsd:sequence 27 xsd:choice minOccurs=0 maxOccurs=unbounded 28 xsd:element ref=package 29 xsd:annotation 30 xsd:documentationAssigns a package to the profile./xsd:documentation 31 /xsd:annotation/xsd:element 32 xsd:element ref=depends 33 xsd:annotation 34 xsd:documentationDependency definition. Allows to refer to another profile which is included./xsd:documentation 35 /xsd:annotation/xsd:element 36 xsd:element ref=variable 37 xsd:annotation 38 xsd:documentationVariable definition./xsd:documentation 39 /xsd:annotation/xsd:element 40 /xsd:choice 41 /xsd:sequence snip 48 /xsd:complexType Without the change, a validation error will always occur. - Brian - wpkg-users mailing list archives http://lists.wpkg.org/pipermail/wpkg-users/ ___ wpkg-users mailing list wpkg-users@lists.wpkg.org http://lists.wpkg.org/mailman/listinfo/wpkg-users
Re: [wpkg-users] Error in profiles.xsd
What I think was happening was the schema validator (PHP5's schemaValidate method in this case) was using the last choice XML node it found within that sequence node. The reason I believe this is the case is because I had profiles that were referencing packages (like they generally should), and the error returned by libxml mentioned that the package XML nodes were unexpected, however it did not complain about any of the depends and variable XML nodes. The XSD files have been a great help in easily validating uploaded package/profile/host XML files for importing into wpkgExpress :-) On 6/17/09, Rainer Meier r.me...@wpkg.org wrote: Hi Brian, mscdex wrote: While finishing up some schema validation stuff for wpkgExpress, I noticed an error in profiles.xsd: ... Without the change, a validation error will always occur. I could not see exactly where there should be an error within the initial XSD. Of course it defined two choices for 0..n occurrences within the sequence but this should be valid (at least Eclipse and its validator did not complain about). However using two choice entries looks super fluent. So I decided to take over your change. http://wpkg.svn.sourceforge.net/viewvc/wpkg/wpkg/stable/1.1/xsd/ Please note that wpkg.js does not use the XSD files for validation. There might be more issues too (it's the first time I wrote such an XSD file ;-)). Mainly I provided them to allow automatic assistance and for documentation reasons (the elements are well-described within the XSD annotations. br, Rainer - wpkg-users mailing list archives http://lists.wpkg.org/pipermail/wpkg-users/ ___ wpkg-users mailing list wpkg-users@lists.wpkg.org http://lists.wpkg.org/mailman/listinfo/wpkg-users