RE: [PHP-DB] xml doccument validation ?????

From: Date: Tue, 21 May 2002 21:58:53 +0000
Subject: RE: [PHP-DB] xml doccument validation ?????
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-19339@lists.php.net to get a copy of this message
the scheema file ..... <?xml version="1.0" encoding="UTF-8"?> <!-- edited with XML Spy v4.3 U (http://www.xmlspy.com) by toby (none) --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="category"> <xs:complexType> <xs:sequence> <xs:element name="cat-id" type="xs:long" maxOccurs="unbounded"/> <xs:element name="parent-cat-id" type="xs:long"/> <xs:element name="cat-name"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="50"/> </xs:restriction> </xs:simpleType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="cntry"> <xs:complexType> <xs:sequence> <xs:element name="cntry-id" type="xs:long" maxOccurs="unbounded"/> <xs:element name="cntry"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="50"/> </xs:restriction> </xs:simpleType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="content-info"> <xs:complexType> <xs:sequence> <xs:element name="sr-no" type="xs:long"/> <xs:element name="lang-id" type="xs:long"/> <xs:element name="cat-id" type="xs:long" maxOccurs="unbounded"/> <xs:element name="memb-id" type="xs:long" maxOccurs="unbounded"/> <xs:element name="body"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="65534"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="date-time" type="xs:date"/> </xs:sequence> </xs:complexType> <xs:keyref name="content_info_memb_id" refer="user_info_memb_id"> <xs:selector xpath="."/> <xs:field xpath="memb_id"/> </xs:keyref> </xs:element> <xs:element name="lang"> <xs:complexType> <xs:sequence> <xs:element name="lang-id" type="xs:long" maxOccurs="unbounded"/> <xs:element name="lang"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="50"/> </xs:restriction> </xs:simpleType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="user-info"> <xs:complexType> <xs:sequence> <xs:element name="role" type="roleType"/> <xs:element name="member"> <xs:complexType> <xs:sequence> <xs:element name="memb-id" type="xs:long"/> <xs:element name="email"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="30"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="name"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="firstName" type="xs:string" use="required"/> <xs:attribute name="middleName" type="xs:string" use="optional"/> <xs:attribute name="lastName" type="xs:string" use="required"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name="login"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="password" type="xs:string" use="required"/> <xs:attribute name="login" type="xs:string" use="required"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name="news-letter-subscription" type="xs:boolean"/> <xs:element name="lang-id" type="xs:long" maxOccurs="unbounded"/> <xs:element name="country"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="20"/> </xs:restriction> </xs:simpleType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> <xs:key name="user_info_memb_id"> <xs:selector xpath="."/> <xs:field xpath="memb_id"/> </xs:key> </xs:element> <xs:element name="user-intf"> <xs:complexType> <xs:sequence> <xs:element name="title"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="65534"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="lang-id" type="xs:long"/> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="roleType"> <xs:sequence> <xs:element name="memb" type="xs:boolean"/> <xs:element name="modrtr" type="xs:boolean"/> </xs:sequence> <xs:attribute name="memb" type="xs:boolean" use="optional"/> <xs:attribute name="modrtr" type="xs:boolean" use="prohibited"/> </xs:complexType> </xs:schema> +++++++++++++++++++++++++++++++++++++++ xml doc .... <?xml version="1.0" encoding="UTF-8"?> <user-info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="F:\New Folder (2)\final project\d bs\proj_db.xsd"> <role> <memb/> <modrtr/> </role> <member> <memb-id/> <email/> <name firstName="" lastName=""/> <login password="" login=""/> <news-letter-subscription/> <lang-id/> <country/> </member> </user-info> i just cant get it validated ... no matter what id do ..... :( +++++++++++++++++++++++++++++++++++++++++++++++ another xml doc that i cant validate .... <?xml version="1.0" encoding="UTF-8"?> <content-info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="F:\New Folder (2)\final project\d bs\proj_db.xsd"> <sr-no/> <lang-id/> <cat-id/> <memb-id/> <body/> <date-time/> </content-info> it gives me error for the date-time thingi .... n ray .... THNX A MILLION BILLION ..... --- Ray Hunter <rhunter@venticon.com> wrote: > Toby, > > First some suggestions...try use dtds for > validation, they are easier to > use. Schemas are complex and you might not be up to > that level. Send > me the schema file and the xml file that you are > trying to validate... > > Thanks, > > Ray Hunter > > > > -----Original Message----- > From: toby z [mailto:blue_myth_1@yahoo.com] > Sent: Tuesday, May 21, 2002 2:33 PM > To: rhunter@venticon.com > Subject: RE: [PHP-DB] xml doccument validation ????? > > > well ray .... its something like .... > > i need to take user input and store it somewhere > .... > and then retrieve it back thru DOM .... > > and i guess i need to store that input in an xml > doccument like the one i sent earlier .... > or do i ???? > > now the thing that im most concerned bout is ..... > this doccument or anyother that i try tomake using > the > scheema doesent get validated .... > i keep getting an error fo one of the fields for > each > ..... > > i've tried changing the field types .... but ... > even that doesnt change anything ...... > > > secondly .... i made a single scheema ..... and i > included all the elements in it ..... > user-info, content-info, categry,...... > with all their subelements ..... > i think im right .... or am i ???? > > third .....i have a few elements in the scheema that > are repeated ..... > > do u think that cud be the problem .... ????? > > so thats it ... > if u want me to tell u more .... plz do let me know > .... > > ray ... can u & will u plz help me vid this ... > im lost ...... > > thnx a million .... > > > toby .... __________________________________________________ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com

« previous php.db (#19339) next »