Hi all,
Am new to XML and have made some XML pages with a DTD and some XSL stylesheets. Am using Stylus studio development environment and when validating the XML for 2 of my XML pages (about.xml, contact.xml) it says it is valid however the other page (catalogue.xml) is displaying errors. Also when looking at my DTD in firefox and IE it is displaying an error:
---firefox---
Quote:
"XML Parsing Error: syntax error
Location: Line Number 2, Column 1:<!ELEMENT MTA (Company*) >
^"
---IE---
Quote:
Cannot have a DTD declaration outside of a DTD. Error processing resource '
<!ELEMENT MTA (Company*) >
----------^
---catalogue.xml---
Code:
<?xml version="1.0" standalone="no"?>
<?xmlstylesheet href="catalogue.xsl" type="text/xsl"?>
<!DOCTYPE MTA SYSTEM "mta.dtd">
<MTA xmlns:xsi=" xsi:noNamespaceSchemaLocation="mta.dtd">
<Company>
<Catalogue>
<Product>
<Prodname>JVC 28" LCD</Prodname>
<Description>28" flat screen 1 Mega Pixel High quality LCD. Silver, includes
stand</Description>
<Price>£650</Price>
</Product>
<Product>
<Prodname>Phillips 36" Wide Screen TV</Prodname>
<Description>36" Wide Screen, with Dolby digital surround sound, black,
includes Stand</Description>
<Price>£500</Price>
</Product>
<Product>
<Prodname>Sony sterio system</Prodname>
<Description>Sony 5 disk interchanger, double cassette, digital radio, 2 100
Watt speakers, with internal sub woofer</Description>
<Price>£400</Price>
</Product>
<Product>
<Prodname>Bush DVD system</Prodname>
<Description>Bush multi regional DVD, includes 5 speaker surround
sound</Description>
<Price>£100</Price>
</Product>
</Catalogue>
</Company>
</MTA>
---catalogue.xml errors---
Quote:
Validating catalogue.xml...
file:///d:/Documents and Settings/Simon/Desktop/Work/Year 3/hypertext/catalogue.xml:12,14: Element 'Description' is not valid for content model: '(Prodname*,Price,Description*)'
file:///d:/Documents and Settings/Simon/Desktop/Work/Year 3/hypertext/catalogue.xml:18,14: Element 'Description' is not valid for content model: '(Prodname*,Price,Description*)'
file:///d:/Documents and Settings/Simon/Desktop/Work/Year 3/hypertext/catalogue.xml:24,14: Element 'Description' is not valid for content model: '(Prodname*,Price,Description*)'
file:///d:/Documents and Settings/Simon/Desktop/Work/Year 3/hypertext/catalogue.xml:30,14: Element 'Description' is not valid for content model: '(Prodname*,Price,Description*)'
file:///d:/Documents and Settings/Simon/Desktop/Work/Year 3/hypertext/catalogue.xml:32,12: Element 'Catalogue' is not valid for content model: '(About,Catalogue?)'
The XML document catalogue.xml is NOT valid (5 errors)
---DTD---
Code:
<?xml version="1.0" ?>
<!ELEMENT MTA (Company*) >
<!ELEMENT Company (About, Catalogue?)>
<!ELEMENT About (Name?, Owners?, Type?, Location?, Info?, Contact?)>
<!ELEMENT Name (#PCDATA)>
<!ELEMENT Owners (#PCDATA)>
<!ELEMENT Type (#PCDATA)>
<!ELEMENT Location (#PCDATA)>
<!ELEMENT Info (#PCDATA)>
<!ELEMENT Contact (Phone?, Email?, Post?)>
<!ELEMENT Phone (#PCDATA)>
<!ELEMENT Email (#PCDATA)>
<!ELEMENT Post (#PCDATA)>
<!ELEMENT Catalogue (Product*)>
<!ELEMENT Product (Prodname*, Price, Description*)>
<!ELEMENT Prodname (#PCDATA)>
<!ELEMENT Price (#PCDATA)>
<!ELEMENT Description (#PCDATA)>
<!ATTLIST MTA xmlns:xsi CDATA #IMPLIED>
<!ATTLIST MTA xsi:noNamespaceSchemaLocation CDATA #IMPLIED>
Any help with this will be much appreciated as I'm on a very tight deadline!!!
regards,
Simon.
Am new to XML and have made some XML pages with a DTD and some XSL stylesheets. Am using Stylus studio development environment and when validating the XML for 2 of my XML pages (about.xml, contact.xml) it says it is valid however the other page (catalogue.xml) is displaying errors. Also when looking at my DTD in firefox and IE it is displaying an error:
---firefox---
Quote:
"XML Parsing Error: syntax error
Location: Line Number 2, Column 1:<!ELEMENT MTA (Company*) >
^"
---IE---
Quote:
Cannot have a DTD declaration outside of a DTD. Error processing resource '
<!ELEMENT MTA (Company*) >
----------^
---catalogue.xml---
Code:
<?xml version="1.0" standalone="no"?>
<?xmlstylesheet href="catalogue.xsl" type="text/xsl"?>
<!DOCTYPE MTA SYSTEM "mta.dtd">
<MTA xmlns:xsi=" xsi:noNamespaceSchemaLocation="mta.dtd">
<Company>
<Catalogue>
<Product>
<Prodname>JVC 28" LCD</Prodname>
<Description>28" flat screen 1 Mega Pixel High quality LCD. Silver, includes
stand</Description>
<Price>£650</Price>
</Product>
<Product>
<Prodname>Phillips 36" Wide Screen TV</Prodname>
<Description>36" Wide Screen, with Dolby digital surround sound, black,
includes Stand</Description>
<Price>£500</Price>
</Product>
<Product>
<Prodname>Sony sterio system</Prodname>
<Description>Sony 5 disk interchanger, double cassette, digital radio, 2 100
Watt speakers, with internal sub woofer</Description>
<Price>£400</Price>
</Product>
<Product>
<Prodname>Bush DVD system</Prodname>
<Description>Bush multi regional DVD, includes 5 speaker surround
sound</Description>
<Price>£100</Price>
</Product>
</Catalogue>
</Company>
</MTA>
---catalogue.xml errors---
Quote:
Validating catalogue.xml...
file:///d:/Documents and Settings/Simon/Desktop/Work/Year 3/hypertext/catalogue.xml:12,14: Element 'Description' is not valid for content model: '(Prodname*,Price,Description*)'
file:///d:/Documents and Settings/Simon/Desktop/Work/Year 3/hypertext/catalogue.xml:18,14: Element 'Description' is not valid for content model: '(Prodname*,Price,Description*)'
file:///d:/Documents and Settings/Simon/Desktop/Work/Year 3/hypertext/catalogue.xml:24,14: Element 'Description' is not valid for content model: '(Prodname*,Price,Description*)'
file:///d:/Documents and Settings/Simon/Desktop/Work/Year 3/hypertext/catalogue.xml:30,14: Element 'Description' is not valid for content model: '(Prodname*,Price,Description*)'
file:///d:/Documents and Settings/Simon/Desktop/Work/Year 3/hypertext/catalogue.xml:32,12: Element 'Catalogue' is not valid for content model: '(About,Catalogue?)'
The XML document catalogue.xml is NOT valid (5 errors)
---DTD---
Code:
<?xml version="1.0" ?>
<!ELEMENT MTA (Company*) >
<!ELEMENT Company (About, Catalogue?)>
<!ELEMENT About (Name?, Owners?, Type?, Location?, Info?, Contact?)>
<!ELEMENT Name (#PCDATA)>
<!ELEMENT Owners (#PCDATA)>
<!ELEMENT Type (#PCDATA)>
<!ELEMENT Location (#PCDATA)>
<!ELEMENT Info (#PCDATA)>
<!ELEMENT Contact (Phone?, Email?, Post?)>
<!ELEMENT Phone (#PCDATA)>
<!ELEMENT Email (#PCDATA)>
<!ELEMENT Post (#PCDATA)>
<!ELEMENT Catalogue (Product*)>
<!ELEMENT Product (Prodname*, Price, Description*)>
<!ELEMENT Prodname (#PCDATA)>
<!ELEMENT Price (#PCDATA)>
<!ELEMENT Description (#PCDATA)>
<!ATTLIST MTA xmlns:xsi CDATA #IMPLIED>
<!ATTLIST MTA xsi:noNamespaceSchemaLocation CDATA #IMPLIED>
Any help with this will be much appreciated as I'm on a very tight deadline!!!
regards,
Simon.