Jump to content
ellc

Schema Basic Syntax

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

Share this post


Link to post
Share on other sites

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>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...