DTD validation error

D

Dima.Breydo

Hello , i'm new to XML so maybe my question is stupid ...

I need to define ENTITY in xml . As i understand in order to do it , I
must add a DTD to xml and then add entity. XMLSPY reports the following
validation validation problem

"Element <Config> has not been declared"

What should i declare and how ?

Thanks a lot,

Dima

This is the xml :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Config [
<!ENTITY empty "␀" >]>

<Config xmlns:md="aaa.com" version="1.0">
<root>
<md:display>/</md:display>
<fff ID="506e738eb3772986" />
<good ID="e903473c054bf906">
<reg ID="f45ab70984dbf5b2">
<md:type>date</md:type>
20060811120100
</reg>
</good>
</root>
<md:ccc>root</md:ccc>
</Config>
 
B

Bjoern Hoehrmann

* (e-mail address removed) wrote in comp.text.xml:
I need to define ENTITY in xml . As i understand in order to do it , I
must add a DTD to xml and then add entity. XMLSPY reports the following
validation validation problem

"Element <Config> has not been declared"

What should i declare and how ?

You could read a tutorial on XML DTDs or perhaps get a DTD from whoever
specified the XML format you are using, but more likely you don't mean
to actually use DTD validation for your document, in which case you can
just ignore the error report.
 
P

Peter Flynn

Hello , i'm new to XML so maybe my question is stupid ...

I need to define ENTITY in xml . As i understand in order to do it , I
must add a DTD to xml and then add entity. XMLSPY reports the following
validation validation problem

"Element <Config> has not been declared"

It's trying to validate the document because it thinks that the presence
of a DocType Declaration means the document is supposed to be valid. As
you presumably don't want validation, just well-formedness, ignore the
warning.
What should i declare and how ?

Your XML is correct as given, for a well-formed document (except that
having declared the entity, you then don't appear to use it :)

///Peter
--
XML FAQ: http://xml.silmaril.ie/
This is the xml :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Config [
<!ENTITY empty "␀" >]>

<Config xmlns:md="aaa.com" version="1.0">
<root>
<md:display>/</md:display>
<fff ID="506e738eb3772986" />
<good ID="e903473c054bf906">
<reg ID="f45ab70984dbf5b2">
<md:type>date</md:type>
20060811120100
</reg>
</good>
</root>
<md:ccc>root</md:ccc>
</Config>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top