Click to See Complete Forum and Search --> : xml and dtd???


bennythemink
01-25-2007, 06:42 AM
guys im new to XML so you'll have to forgive the newbie question,

if i have an xml file and a DTD to compare it against to ensure it is in the correct format sitting on my harddrive, whats the actions i have to perform to get this check to happen?

am i going about this the wrong way? does the browser handle this if i try to view the XML file?


any help is appreciated.

thanks
benny

Charles
01-25-2007, 07:55 AM
Any validating parser will do that for you and MSIE has one built in. Firefox as well I thinik but that browser's command on XML is limited. Just try to view the XML in one of those two browsers.

bennythemink
01-25-2007, 08:10 AM
ok thanks, just one more thing, i want to take this XML file thats on my computer, compare it to the DTD and if alls well parse it into a database.

i just want to know how il get the comparison done before i start to parse in the file?

any suggestions?


thanks again for your replys.

Charles
01-25-2007, 08:15 AM
How are you parsing it into the database? The parser might do the checking for you and exit with an error if the XML is invalid.

bennythemink
01-25-2007, 11:00 AM
il be using PHP to parse it into a mySQL database. do you know if php's xml_parser will perform this check?

Charles
01-25-2007, 11:18 AM
Give it a try.