Jump to content

Schema Basic Syntax


ellc

Recommended Posts

Hi,I am at a loss of what to do. Basically I like to structure my docs in such a way thatSchema Name: Bookmarks.xsd with sub bookmarksSub bookmarks includes: Rating, Title, URLSub Sub Bookmark Under URL(Called Subpage) includes: Subpages, subURLI tried with below code it just doesn't work.___________________InfoAuthorIdCompanyYearShortDescription__________________<?xml version="1.0"?><xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3schools.com"elementFormDefault="unqualified" attributeFormDefault="unqualified"> <xsd:element name="Mybookmark"> <xsd:element name="info" type="xsd:string"/> <xsd:element name="author" type="xsd:string"/> <xsd:element name="id" type="xsd:string"/> <xsd:element name="company" type="xsd:string"/> <xsd:element name="year" type="xsd:integer"/> <xsd:element name="shortdescription" type="xsd:string"/> <element name="Bookmark"> <complexType> <sequence> <xsd:element name="rating" type="integer"/> <xsd:element name="title" type="string"/> <xsd:element name="URL" type="string"/> <xsd:element name="postdate" type="xmp:date"/> <complexType name="subpages"> <sequence> <xsd:element name="subtitle" type="string"/> <xsd:element name="subURL" type="string"/> </sequence> </complexType> </sequence> </complexType> </element> </xsd:element><complexType name="Bookmarks"></complexType ></xsd:schema> :(Regards, ellc

Link to comment
Share on other sites

  • 1 month later...

Just some elements in the wrong place and no namespace of others.Try this an see how you go. The subpages might be in the wrong spot, it wasn't quite clear from your post. <xsd:element name="Mybookmark"> <xsd:complexType> <xsd:sequence> <xsd:element name="info" type="xsd:string"/> <xsd:element name="author" type="xsd:string"/> <xsd:element name="id" type="xsd:string"/> <xsd:element name="company" type="xsd:string"/> <xsd:element name="year" type="xsd:integer"/> <xsd:element name="shortdescription" type="xsd:string"/> <xsd:element name="Bookmark"> <xsd:complexType> <xsd:sequence> <xsd:element name="rating" type="integer"/> <xsd:element name="title" type="string"/> <xsd:element name="URL" type="string"/> <xsd:element name="postdate" type="xsd:date"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="subpages"> <xsd:complexType> <xsd:sequence> <xsd:element name="subtitle" type="string" /> <xsd:element name="subURL" type="string" /> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...