question about libxml
-
hi,everybody Did you use "libxml" to parse your xml file ? I need your help .:confused::confused: how do I parse dtd file by libxml ? after I parse dtd file ,how do I take use of result for parsing xml file ? such as ,my dtd file is Goodxml2.dtd ----------- --------------------------------- my xml fils is Goodxml2.xml ----------------- Du Peng Chao Today Story ---------------------------------------------- how do I parse dtd file by libxml ? then take use of parsing result to parse xml file for get element content ? thank you very much :confused:
-
hi,everybody Did you use "libxml" to parse your xml file ? I need your help .:confused::confused: how do I parse dtd file by libxml ? after I parse dtd file ,how do I take use of result for parsing xml file ? such as ,my dtd file is Goodxml2.dtd ----------- --------------------------------- my xml fils is Goodxml2.xml ----------------- Du Peng Chao Today Story ---------------------------------------------- how do I parse dtd file by libxml ? then take use of parsing result to parse xml file for get element content ? thank you very much :confused:
Regardless of what libxml is, I see an error in what you show : a DTD doesn't have headers like <?xml...
-
Regardless of what libxml is, I see an error in what you show : a DTD doesn't have headers like <?xml...
-
I use the "xml spy ide " tool to generate my dtd file there has the headers ant no error reported . :-D
storein wrote: ant no error reported No error reported in what tool ? xml spy ? Again, a DTD is not written with Xml syntax, so not only the <?xml header is useless, it may do bad things depending on the parser you use (libxml, msxml, expat, .NET xml, ...)
-
storein wrote: ant no error reported No error reported in what tool ? xml spy ? Again, a DTD is not written with Xml syntax, so not only the <?xml header is useless, it may do bad things depending on the parser you use (libxml, msxml, expat, .NET xml, ...)
Yes. of course ,you are right , there is no this header . when you write your program ,how do you use your DTD file that corresponds your xml file ? only validate the xml file ? DTD file is GoodXml.dtd ----------- --------------------------------- XML file is GoodXml.xml ----------------- Du Peng Chao Today Story ---------------------------------------------- do you use DTD file to validate only xml file ? whether I can parse DTD file first ,get element "bookshell ,book,author,title ",then use the element to parse xml file ? in a word ,parse dtd file dynamicly ,parse xml file dynamicly ,then get element content . thank you in advance .
-
Yes. of course ,you are right , there is no this header . when you write your program ,how do you use your DTD file that corresponds your xml file ? only validate the xml file ? DTD file is GoodXml.dtd ----------- --------------------------------- XML file is GoodXml.xml ----------------- Du Peng Chao Today Story ---------------------------------------------- do you use DTD file to validate only xml file ? whether I can parse DTD file first ,get element "bookshell ,book,author,title ",then use the element to parse xml file ? in a word ,parse dtd file dynamicly ,parse xml file dynamicly ,then get element content . thank you in advance .
I don't understand what you want to do, and as I don't know libxml either, I guess the discussion is in no way of getting a way out. The only thing I can tell you is that you should never parse a DTD yourself. You should rely on an existing xml parser for this purpose.
-
I don't understand what you want to do, and as I don't know libxml either, I guess the discussion is in no way of getting a way out. The only thing I can tell you is that you should never parse a DTD yourself. You should rely on an existing xml parser for this purpose.
-
hi,everybody Did you use "libxml" to parse your xml file ? I need your help .:confused::confused: how do I parse dtd file by libxml ? after I parse dtd file ,how do I take use of result for parsing xml file ? such as ,my dtd file is Goodxml2.dtd ----------- --------------------------------- my xml fils is Goodxml2.xml ----------------- Du Peng Chao Today Story ---------------------------------------------- how do I parse dtd file by libxml ? then take use of parsing result to parse xml file for get element content ? thank you very much :confused:
Just my 2 cents here but why a old DTD format? For my area we only use XSD for new work. Second what goal are you wanting? If it is to validate the file then use the existing tools. If it is to make a data entry form then I can see some use. "I will find a new sig someday."
-
Just my 2 cents here but why a old DTD format? For my area we only use XSD for new work. Second what goal are you wanting? If it is to validate the file then use the existing tools. If it is to make a data entry form then I can see some use. "I will find a new sig someday."
Thank you reply . I want to write c program that parse dynamicly dtd file , get the element ,and take use of these element to parse xml file for getting the element't content such as : DTD file is GoodXml.dtd ----------- --------------------------------- XML file is GoodXml.xml ----------------- Du Peng Chao Today Story ---------------------------------------------- firstly , the program parse GoodXml.dtd file ,get element "bookshell ,book,author,title ", secondly, use the element to parse xml file , get the content "Du Peng Chao" and "Today Story" of course ,I use libxml ,not write parser myself. in a word ,parse dtd file dynamicly ,parse xml file dynamicly ,then get element content . thank you in advance .
-
Thank you reply . I want to write c program that parse dynamicly dtd file , get the element ,and take use of these element to parse xml file for getting the element't content such as : DTD file is GoodXml.dtd ----------- --------------------------------- XML file is GoodXml.xml ----------------- Du Peng Chao Today Story ---------------------------------------------- firstly , the program parse GoodXml.dtd file ,get element "bookshell ,book,author,title ", secondly, use the element to parse xml file , get the content "Du Peng Chao" and "Today Story" of course ,I use libxml ,not write parser myself. in a word ,parse dtd file dynamicly ,parse xml file dynamicly ,then get element content . thank you in advance .
From what you describe I can just parse the XML file and get the tags and data from it. I do not get anything from reading the DTD. "I will find a new sig someday."
-
From what you describe I can just parse the XML file and get the tags and data from it. I do not get anything from reading the DTD. "I will find a new sig someday."