Alright, so I am about to start a course about XML in MSSQL2005 and I started to read a little bit before that course.This is my DTD, person.dtd:<!ELEMENT person (name, profession*)><!ELEMENT name (first_name, last_name)><!ELEMENT first_name (#PCDATA)><!ELEMENT last_name (#PCDATA)><!ELEMENT profession (#PCDATA)>
person.xml:<?xml version="1.0" standalone="no"?><!DOCTYPE person SYSTEM "person.dtd"><person> <profession>computer scientist</profession> <name> <first_name>Alan</first_name> <first_name>Tomas</first_name> <first_name>Carl</first_name> <last_name>Turing</last_name> </name> <profession>mathematician</profession> <profession>cryptographer</profession></person>
Unfortunatly, for some reason the XML goes through when there should be a validation error on:* <profession>computer scientist</profession> (Not allowed in the element person)* <first_name>Tomas</first_name> (Only one first_name element allowed in <name>)I also tried this but with no validation error:<?xml version="1.0"?><!DOCTYPE person [ <!ELEMENT first_name (#PCDATA)> <!ELEMENT last_name (#PCDATA)> <!ELEMENT profession (#PCDATA)> <!ELEMENT name (first_name, last_name)> <!ELEMENT person (name, profession*)>]><person> <name> <first_name>Alan</first_name> <last_name>Turing</last_name> </name> <profession>computer scientist</profession> <profession>mathematician</profession> <profession>cryptographer</profession></person>
I have open the XML in both Internet Explorer, Firefox and two rule out if the browsers doesen't do any validation I also tried XMLFox without any result.Can anyone assist me on this one?Best Regards,KFluffie