You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andreas Look <al...@justis.de> on 2000/09/04 19:44:57 UTC

How to write valid documents?

I am trying to use the id()-function, but it did not work and I got
information that the parser has to be validating for this function to
work.
Now I wrote a correct dtd for my xml-file and another one for my xsl.
For the xsl-dtd I copied and  pasted a a huge list of entities, element
declarations and 
attlists from a w3c-documentation on XSLT.
After that I copied "http://www.w3.org/TR/html4/strict.dtd" on my local
file system
( because the parser did not understand all of the syntax used in the
original file )
and put a "<!ENTITY % strict SYSTEM "strict.dtd"> %strict; into the
xsl-dtd.
I think this should work.
But the validating parser ( I use xalan and xerces ) brings up this
error message ( by using the browser ):
 RuntimeException: org.xml.sax.SAXParseException: Attribute "version"
must be declared for element type "xsl:stylesheet".
But this attribute is defined in my xsl-dtd file.

By starting the transformation by commando line with:
 java org.apache.xalan.xslt.Process -in page1.xml -out page1.html
-VALIDATE
a different errors  occur:
 processing-instruction name must be a valid NCName: page1.xsl
 Parser error: Element type "html" must be declared.
 Parser error: Element type "head" must be declared.
 Parser error: Element type "title" must be declared.
 Parser error: Attribute "bgcolor" must be declared for element type
"body".

Can anybody tell me what  my problem is? I am trying now for several
days and
I would really like to use XML for my next project.
regards

--
Dipl.-Ing. (FH) Andreas Look
Tel : +49(0)711-820507-30   	Just Innovative Software GmbH
Fax : +49(0)711-820507-79       Heimsheimer Strasse 1                
E-Mail : alook@justis.de       	D-70499 Stuttgart