W
Wole Ogunremi
I guess this is a well asked question but it is tripping me up!
I'm putting a forum together allowing xhtml markup content. I am validating
against a schema but getting "Could not find schema information for element
<elementName>...
I would appreciate if anyone could advice where I am going wrong. TIA
Here's my xsd:
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="Topics" targetNamespace="http://www.test.com/Topics.xsd"
elementFormDefault="qualified"
xmlns:tes="http://www.test.com/Topics.xsd"
xmlns="http://www.test.com/Topics.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="ForumTopic">
<xs:complexType>
<xs:sequence>
<xs:element name="TopicID" type="xs:ID" minOccurs="1" maxOccurs="1" />
<xs:element name="MainThread" type="tes:Thread" minOccurs="1"
maxOccurs="1" />
<xs:choice>
<xs:element name="SubThreads" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="ReceivingReplys" type="xs:boolean" />
<xs:element name="SubThread" minOccurs="0" maxOccurs="unbounded"
type="tes:Thread" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="IsLockedThread" type="xs:boolean" fixed="true" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="OnDateTime">
<xs:sequence>
<xs:element name="OnDate" type="xs:date" minOccurs="1" maxOccurs="1" />
<xs:element name="AtTime" type="xs:time" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="Thread">
<xs:sequence>
<xs:element name="ThreadID" type="xs:ID" minOccurs="1" maxOccurs="1" />
<xs:element name="AuthorID" type="xs:string" minOccurs="1" maxOccurs="1"
/>
<xs:element name="Created" type="OnDateTime" minOccurs="1" maxOccurs="1"
/>
<xs:element name="Modified" type="OnDateTime" minOccurs="0" maxOccurs="1"
/>
<xs:element name="Subject" type="xs:string" minOccurs="1" maxOccurs="1"
/>
<xs:element name="Content" maxOccurs="1" minOccurs="1">
<xs:complexType mixed="true">
<xs:sequence>
<xs:any maxOccurs="unbounded" minOccurs="0"
namespace="http://www.w3.org/1999/xhtml" processContents="lax" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="ParentThreadID" type="xs:string" use="required" />
</xs:complexType>
</xs:schema>
And here is my xml
<?xml version="1.0" encoding="utf-8" ?>
<tes:ForumTopic xmlns:tes="http://www.test.com/Topics.xsd"
xmlns:xh="http://www.w3.org/1999/xhtml">
<tes:TopicID>topic2</tes:TopicID>
<tes:MainThread ParentThreadID="topic2">
<tes:ThreadID>thrd1</tes:ThreadID>
<tes:AuthorID>wolex</tes:AuthorID>
<tes:Created>
<tes:OnDate>2004-11-08</tes:OnDate>
<tes:AtTime>10:14:21</tes:AtTime>
</tes:Created>
<tes:Subject>Test post</tes:Subject>
<tes:Content>
<xh>Par<xh:b>agr</xh:b>aph 1</xh>
<xh>Paragraph 2</xh>
<xh>Paragraph 3</xh>
</tes:Content>
</tes:MainThread>
<tes:SubThreads>
<tes:ReceivingReplys>true</tes:ReceivingReplys>
<tes:SubThread ParentThreadID="thrd1">
<tes:ThreadID>thrd2</tes:ThreadID>
<tes:AuthorID>wolex</tes:AuthorID>
<tes:Created>
<tes:OnDate>2004-11-08</tes:OnDate>
<tes:AtTime>10:19:32</tes:AtTime>
</tes:Created>
<tes:Subject>Your post makes no sense</tes:Subject>
<tes:Content>
<xh>Paragraph 1 is not right.</xh>
</tes:Content>
</tes:SubThread>
<tes:SubThread ParentThreadID="thrd2">
<tes:ThreadID>thrd3</tes:ThreadID>
<tes:AuthorID>Anonymous</tes:AuthorID>
<tes:Created>
<tes:OnDate>2004-11-27</tes:OnDate>
<tes:AtTime>14:17:09</tes:AtTime>
</tes:Created>
<tes:Subject>RE: Test</tes:Subject>
<tes:Content>
<xh><xh:b>Police searches</xh:b></xh>
<xh>"We want justice done. Some one killed him and that person has to
be locked up." </xh>
<xh>Mr Taylor said he still found the loss of his son "difficult to
cope with". </xh>
<xh>Police said in October they had searched several Peckham homes the
previous month. </xh>
<xh>At the time Scotland Yard said it was confident the case would be
solved. </xh>
<xh>Mr Taylor said he hopes to pass on positive lessons learned from
his son's death to young people in London and to raise awareness among
children of the danger of carrying weapons. </xh>
<xh>However, he urged parents to take a stronger role in looking after
their children. </xh>
<xh>"From leaving home in the morning to when he comes back in the
evening because what the child does outside - [parents are] oblivious to
it," he said. </xh>
<xh>Dean of Southwark Colin Slee said police had done a lot of work in
the Peckham to improve safety. </xh>
<xh>"I think children feel safe when they are in school, both primary
and secondary, but it's when they are on the streets that there's a
difficulty." </xh>
</tes:Content>
</tes:SubThread>
<tes:SubThread ParentThreadID="thrd3">
<tes:ThreadID>thrd4</tes:ThreadID>
<tes:AuthorID>Anonymous</tes:AuthorID>
<tes:Created>
<tes:OnDate>2004-11-27</tes:OnDate>
<tes:AtTime>14:31:36</tes:AtTime>
</tes:Created>
<tes:Subject>RE: Test</tes:Subject>
<tes:Content>
<xh xmlns="">Differences Between HTML and XHTML<xh:br />
The <blockquote> tag is supposed to contain only block-level elements
within it, and not just plain text.</xh>
<xh xmlns="">To validate the page as strict XHTML, you must add a
block-level element around the text within the <blockquote> tag, like
this:</xh>
<xh xmlns=""><blockquote><xh:br />
<p>here is a long quotation here is a long quotation</p><xh:br
/>
</blockquote></xh>
<xh xmlns="">
</xh>
</tes:Content>
</tes:SubThread>
<tes:SubThread ParentThreadID="thrd4">
<tes:ThreadID>thrd5</tes:ThreadID>
<tes:AuthorID>Anonymous</tes:AuthorID>
<tes:Created>
<tes:OnDate>2004-11-27</tes:OnDate>
<tes:AtTime>14:43:50</tes:AtTime>
</tes:Created>
<tes:Subject>RE: Test</tes:Subject>
<tes:Content>
<xh xmlns="">
<xh:b>Parental problems</xh:b>
</xh>
<xh xmlns="">He too was confident the killer would be caught as
the "gap" between police and the community was changing for the better.
</xh>
<xh xmlns="">"I think ultimately the killers will be found."
</xh>
<xh xmlns="">He said the role of parents was the most important
aspect. </xh>
<xh xmlns="">"All of the head teachers that I speak to say that
they are fairly content with the security of the children in school and not
content with the way parents are behaving." </xh>
<xh xmlns="">He said children "are kicked out in the morning and
told to go to school by themselves in street that are quite dark", children
frequently return home to empty houses, or wander the streets, often in
groups "purely because they are bored".</xh>
</tes:Content>
</tes:SubThread>
<tes:SubThread ParentThreadID="thrd5">
<tes:ThreadID>thrd6</tes:ThreadID>
<tes:AuthorID>Anonymous</tes:AuthorID>
<tes:Created>
<tes:OnDate>2004-11-27</tes:OnDate>
<tes:AtTime>14:46:11</tes:AtTime>
</tes:Created>
<tes:Subject>RE: Test</tes:Subject>
<tes:Content>
<xh xmlns="">
<xh:b>Parental problems</xh:b>
</xh>
<xh xmlns="">He too was confident the killer would be caught as
the "gap" between police and the community was changing for the better.
</xh>
<xh xmlns="">"I think ultimately the killers will be found."
</xh>
<xh xmlns="">He said the role of parents was the most important
aspect. </xh>
<xh xmlns="">"All of the head teachers that I speak to say that
they are fairly content with the security of the children in school and not
content with the way parents are behaving." </xh>
<xh xmlns="">He said children "are kicked out in the morning and
told to go to school by themselves in street that are quite dark", children
frequently return home to empty houses, or wander the streets, often in
groups "purely because they are bored".</xh>
</tes:Content>
</tes:SubThread>
<tes:SubThread ParentThreadID="thrd5">
<tes:ThreadID>thrd6</tes:ThreadID>
<tes:AuthorID>Anonymous</tes:AuthorID>
<tes:Created>
<tes:OnDate>2004-11-27</tes:OnDate>
<tes:AtTime>15:12:06</tes:AtTime>
</tes:Created>
<tes:Subject>RE: Test</tes:Subject>
<tes:Content>
<xh>
<xh:img
src="http://newsimg.bbc.co.uk/media/images/40566000/jpg/_40566183_india_also66.jpg"
wole="4" />
</xh>
</tes:Content>
</tes:SubThread>
</tes:SubThreads>
</tes:ForumTopic>
I'm putting a forum together allowing xhtml markup content. I am validating
against a schema but getting "Could not find schema information for element
<elementName>...
I would appreciate if anyone could advice where I am going wrong. TIA
Here's my xsd:
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="Topics" targetNamespace="http://www.test.com/Topics.xsd"
elementFormDefault="qualified"
xmlns:tes="http://www.test.com/Topics.xsd"
xmlns="http://www.test.com/Topics.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="ForumTopic">
<xs:complexType>
<xs:sequence>
<xs:element name="TopicID" type="xs:ID" minOccurs="1" maxOccurs="1" />
<xs:element name="MainThread" type="tes:Thread" minOccurs="1"
maxOccurs="1" />
<xs:choice>
<xs:element name="SubThreads" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="ReceivingReplys" type="xs:boolean" />
<xs:element name="SubThread" minOccurs="0" maxOccurs="unbounded"
type="tes:Thread" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="IsLockedThread" type="xs:boolean" fixed="true" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="OnDateTime">
<xs:sequence>
<xs:element name="OnDate" type="xs:date" minOccurs="1" maxOccurs="1" />
<xs:element name="AtTime" type="xs:time" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="Thread">
<xs:sequence>
<xs:element name="ThreadID" type="xs:ID" minOccurs="1" maxOccurs="1" />
<xs:element name="AuthorID" type="xs:string" minOccurs="1" maxOccurs="1"
/>
<xs:element name="Created" type="OnDateTime" minOccurs="1" maxOccurs="1"
/>
<xs:element name="Modified" type="OnDateTime" minOccurs="0" maxOccurs="1"
/>
<xs:element name="Subject" type="xs:string" minOccurs="1" maxOccurs="1"
/>
<xs:element name="Content" maxOccurs="1" minOccurs="1">
<xs:complexType mixed="true">
<xs:sequence>
<xs:any maxOccurs="unbounded" minOccurs="0"
namespace="http://www.w3.org/1999/xhtml" processContents="lax" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="ParentThreadID" type="xs:string" use="required" />
</xs:complexType>
</xs:schema>
And here is my xml
<?xml version="1.0" encoding="utf-8" ?>
<tes:ForumTopic xmlns:tes="http://www.test.com/Topics.xsd"
xmlns:xh="http://www.w3.org/1999/xhtml">
<tes:TopicID>topic2</tes:TopicID>
<tes:MainThread ParentThreadID="topic2">
<tes:ThreadID>thrd1</tes:ThreadID>
<tes:AuthorID>wolex</tes:AuthorID>
<tes:Created>
<tes:OnDate>2004-11-08</tes:OnDate>
<tes:AtTime>10:14:21</tes:AtTime>
</tes:Created>
<tes:Subject>Test post</tes:Subject>
<tes:Content>
<xh>Par<xh:b>agr</xh:b>aph 1</xh>
<xh>Paragraph 2</xh>
<xh>Paragraph 3</xh>
</tes:Content>
</tes:MainThread>
<tes:SubThreads>
<tes:ReceivingReplys>true</tes:ReceivingReplys>
<tes:SubThread ParentThreadID="thrd1">
<tes:ThreadID>thrd2</tes:ThreadID>
<tes:AuthorID>wolex</tes:AuthorID>
<tes:Created>
<tes:OnDate>2004-11-08</tes:OnDate>
<tes:AtTime>10:19:32</tes:AtTime>
</tes:Created>
<tes:Subject>Your post makes no sense</tes:Subject>
<tes:Content>
<xh>Paragraph 1 is not right.</xh>
</tes:Content>
</tes:SubThread>
<tes:SubThread ParentThreadID="thrd2">
<tes:ThreadID>thrd3</tes:ThreadID>
<tes:AuthorID>Anonymous</tes:AuthorID>
<tes:Created>
<tes:OnDate>2004-11-27</tes:OnDate>
<tes:AtTime>14:17:09</tes:AtTime>
</tes:Created>
<tes:Subject>RE: Test</tes:Subject>
<tes:Content>
<xh><xh:b>Police searches</xh:b></xh>
<xh>"We want justice done. Some one killed him and that person has to
be locked up." </xh>
<xh>Mr Taylor said he still found the loss of his son "difficult to
cope with". </xh>
<xh>Police said in October they had searched several Peckham homes the
previous month. </xh>
<xh>At the time Scotland Yard said it was confident the case would be
solved. </xh>
<xh>Mr Taylor said he hopes to pass on positive lessons learned from
his son's death to young people in London and to raise awareness among
children of the danger of carrying weapons. </xh>
<xh>However, he urged parents to take a stronger role in looking after
their children. </xh>
<xh>"From leaving home in the morning to when he comes back in the
evening because what the child does outside - [parents are] oblivious to
it," he said. </xh>
<xh>Dean of Southwark Colin Slee said police had done a lot of work in
the Peckham to improve safety. </xh>
<xh>"I think children feel safe when they are in school, both primary
and secondary, but it's when they are on the streets that there's a
difficulty." </xh>
</tes:Content>
</tes:SubThread>
<tes:SubThread ParentThreadID="thrd3">
<tes:ThreadID>thrd4</tes:ThreadID>
<tes:AuthorID>Anonymous</tes:AuthorID>
<tes:Created>
<tes:OnDate>2004-11-27</tes:OnDate>
<tes:AtTime>14:31:36</tes:AtTime>
</tes:Created>
<tes:Subject>RE: Test</tes:Subject>
<tes:Content>
<xh xmlns="">Differences Between HTML and XHTML<xh:br />
The <blockquote> tag is supposed to contain only block-level elements
within it, and not just plain text.</xh>
<xh xmlns="">To validate the page as strict XHTML, you must add a
block-level element around the text within the <blockquote> tag, like
this:</xh>
<xh xmlns=""><blockquote><xh:br />
<p>here is a long quotation here is a long quotation</p><xh:br
/>
</blockquote></xh>
<xh xmlns="">
</xh>
</tes:Content>
</tes:SubThread>
<tes:SubThread ParentThreadID="thrd4">
<tes:ThreadID>thrd5</tes:ThreadID>
<tes:AuthorID>Anonymous</tes:AuthorID>
<tes:Created>
<tes:OnDate>2004-11-27</tes:OnDate>
<tes:AtTime>14:43:50</tes:AtTime>
</tes:Created>
<tes:Subject>RE: Test</tes:Subject>
<tes:Content>
<xh xmlns="">
<xh:b>Parental problems</xh:b>
</xh>
<xh xmlns="">He too was confident the killer would be caught as
the "gap" between police and the community was changing for the better.
</xh>
<xh xmlns="">"I think ultimately the killers will be found."
</xh>
<xh xmlns="">He said the role of parents was the most important
aspect. </xh>
<xh xmlns="">"All of the head teachers that I speak to say that
they are fairly content with the security of the children in school and not
content with the way parents are behaving." </xh>
<xh xmlns="">He said children "are kicked out in the morning and
told to go to school by themselves in street that are quite dark", children
frequently return home to empty houses, or wander the streets, often in
groups "purely because they are bored".</xh>
</tes:Content>
</tes:SubThread>
<tes:SubThread ParentThreadID="thrd5">
<tes:ThreadID>thrd6</tes:ThreadID>
<tes:AuthorID>Anonymous</tes:AuthorID>
<tes:Created>
<tes:OnDate>2004-11-27</tes:OnDate>
<tes:AtTime>14:46:11</tes:AtTime>
</tes:Created>
<tes:Subject>RE: Test</tes:Subject>
<tes:Content>
<xh xmlns="">
<xh:b>Parental problems</xh:b>
</xh>
<xh xmlns="">He too was confident the killer would be caught as
the "gap" between police and the community was changing for the better.
</xh>
<xh xmlns="">"I think ultimately the killers will be found."
</xh>
<xh xmlns="">He said the role of parents was the most important
aspect. </xh>
<xh xmlns="">"All of the head teachers that I speak to say that
they are fairly content with the security of the children in school and not
content with the way parents are behaving." </xh>
<xh xmlns="">He said children "are kicked out in the morning and
told to go to school by themselves in street that are quite dark", children
frequently return home to empty houses, or wander the streets, often in
groups "purely because they are bored".</xh>
</tes:Content>
</tes:SubThread>
<tes:SubThread ParentThreadID="thrd5">
<tes:ThreadID>thrd6</tes:ThreadID>
<tes:AuthorID>Anonymous</tes:AuthorID>
<tes:Created>
<tes:OnDate>2004-11-27</tes:OnDate>
<tes:AtTime>15:12:06</tes:AtTime>
</tes:Created>
<tes:Subject>RE: Test</tes:Subject>
<tes:Content>
<xh>
<xh:img
src="http://newsimg.bbc.co.uk/media/images/40566000/jpg/_40566183_india_also66.jpg"
wole="4" />
</xh>
</tes:Content>
</tes:SubThread>
</tes:SubThreads>
</tes:ForumTopic>