Jump to content

XML validation doubt


Guest Prasanth K P

Recommended Posts

Guest Prasanth K P

I am totally new to XML.I tried creating an xml and validating it against dtd.But its still displaying the xml.Its not getting validated or giving errors.<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE note [ <!ELEMENT note (to, from, heading, body)> <!ELEMENT to (#PCDATA)> <!ELEMENT from (#PCDATA)> <!ELEMENT heading (#PCDATA)> <!ELEMENT body (#PCDATA)>]><note> <toc>Tove</toc> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body></note>

Link to comment
Share on other sites

Try doing anything with the data by using a script that actually validates the input before making the query. You won't succeed at that point. The DTD makes sure of it.

Link to comment
Share on other sites

I guess you haven't validated the xml file against the dtd. You need to use any tool/xml editor (google on net) to validate. When we say validation it checks only the document against the dtd definition; dont expect any output as in any prog language.vinay.

I am totally new to XML.I tried creating an xml and validating it against dtd.But its still displaying the xml.Its not getting validated or giving errors.<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE note [ <!ELEMENT note (to, from, heading, body)> <!ELEMENT to (#PCDATA)> <!ELEMENT from (#PCDATA)> <!ELEMENT heading (#PCDATA)> <!ELEMENT body (#PCDATA)>]><note> <toc>Tove</toc> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body></note>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...