|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
newbie at XML, please help!
I have to port data in a xml file and putting them into a DB
(I am using Windows + Apache + PHP + MySQL), and all that work fine, but I want to validate de XML document with a DTD and here's the problem, because I have as a result no validation at all... I'm posting some code as example, eg. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE employee SYSTEM "F:\path-to-file\employee.dtd"> <employee category="A"> <name>N.N</name> <address>something</address> <phone>something</phone> </employee> ----- Then the employee.dtd, <!ELEMENT employee (name, address, phone) > <!ATTLIST employee category ( A| B| C) > <!ELEMENT name (#PCDATA) > <!ELEMENT address (#PCDATA) > <!ELEMENT phone (#PCDATA) > Perhaps there is something wrong at the way I am working with, because if I write <employee category="J"> no error is reported. thanxs in advance. Last edited by angel : July 11th, 2001 at 12:34 PM. |
|
#2
|
|||
|
|||
|
Maybe you use a non-validating parser.
Your Code is correct. So try the xml-spy, you can download it at www.xmlspy.com. It's a very good xml-editor, which validates your code, generates DTD's ... |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > newbie at XML, please help! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|