[
Lists Home |
Date Index |
Thread Index
]
Hi All,
We all know that we validate our XML document with DTD. But the
problem that i'm facing is:
DTD is allowing certain tags that are not earlier specified in DTD. I am
not even using CDATA section that means the tags not specified in DTD are
also getting parsed.
For example:
File name: Untitled1.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XML Spy v4.2 U (http://www.xmlspy.com) by Reema Duggal
(RMSI) -->
<!DOCTYPE root SYSTEM "Untitled2.dtd">
<root>
<testnode>
<testnode1/>
</testnode>
</root>
DTD used: Untitled2.dtd
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XML Spy v4.2 U (http://www.xmlspy.com) by Reema Duggal
(RMSI) -->
<!--DTD generated by XML Spy v4.2 U (http://www.xmlspy.com)-->
<!ELEMENT root (testnode)>
<!ELEMENT testnode (#PCDATA)>
So instead of specifying tags like this: <testnode1>, if we write
<testnode1> then the XML file gets validated without giving any
errors. But "testnode1" element is not specified in DTD.
How can this be possible?? Why the DTD is not validating it??
Waiting for reply..
Regards,
Reema Duggal
Software Engineer ( Software )
NewMedia
RMSI
A-7 Sector - 16
Noida-201 301 India
Tel : (91)-118-451-1102-2302
Fax: (91)-118-451-1109, 0963
E-mail: reemad@riskinc.com
web : www.rmsinet.com
|