You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Dave Overbeck <dh...@rcn.com> on 2001/04/21 21:39:08 UTC

using xsd schema in document?

I am trying to get some simple test pages going with Cocoon using my own
schema for validation, but when I do the Cocoon processing seems to be
skipped altogether.  The Hello sample works fine as is, and the version
below (with the cocoon references commented out) also works fine on my
parser, but Cocoon ignores it.  Am I referencing the schema
incorrectly?  Does Cocoon require a DTD as opposed to a schema?  I can't
find any reference to this in the docs, faqs, archives, etc.  My host is
using 1.8.2.

Thanks,
Dave Overbeck


Hello1.xml:
----------------------------------------------
<?xml version="1.0"?>
<?xml-stylesheet href="hello-page-html.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>

<page xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="Hello1.xsd">
 <title>Hello</title>
 <content>
  <paragraph>This is my first Cocoon page!</paragraph>
 </content>
</page>


Hello1.xsd:
----------------------------------------------
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema">

 <xsd:element name="hello" type="helloType"/>

 <xsd:complexType name="helloType">
  <xsd:element name="title" type="xsd:string" minOccurs="1"
maxOccurs="1"></xsd:element>
  <xsd:element name="content" type="contentType" minOccurs="1"
maxOccurs="1"></xsd:element>
 </xsd:complexType>

 <xsd:complexType name="contentType">
   <xsd:element name="paragraph" type="xsd:string" minOccurs="1"
maxOccurs="unbounded"></xsd:element>
 </xsd:complexType>

</xsd:schema>

----------------------------------------------
(stylesheet is the same)








---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>