![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
question about XML and DTD
Hi,
Got stuck with this. I have a xml file which contains entities like "pound", "hellip" since these are non standard entities, xmllint fails to validate the XML file. So, I created a DTD file with the external entities in place, once the DTD is provided as internal DTD to the XML file, the validation is smooth. How do I achieve the same result with the DTD as an external one ? I wont be unable to use internal DTD as I can't change the source file. Is there any way to pass DTD as argument to xmllint and make the validation smoother ? I tried with the options of xmllint and other web links but still fighting. Could you please throw upon some light on this ? Thanks |
|
||||
|
Di you try xmllint --dtdattr <filename> to load external DTD files? For external DTD files to work they still have to declared inside your xml file:
Code:
<!DOCTYPE mydtd SYSTEM "mydtd.dtd"> |
|
||||
|
hi jim,
thanks for the reply if the DTD is included in the source file and with either of the xmllint commands Code:
xmllint --noout --loaddtd file.xml Code:
xmllint --noout --dtdattr file.xml but in either of the case, source file needs to be modified which is not possible in my case So, is there any other way to use the dtd in the command line ( as an external dtd ) and not to alter the source file |
|
||||
|
No way you can create a temp file with the DTD inlined? You will know exactly what you added, so if it validates, the original was valid, too.
(Workaround zone here. More properly, if there is no way to persuade xmllint to read an external DTD then it's really time to find, or write, a tool which can do that.) |
|
||||
|
thanks for the reply era.
I had the approach you proposed already ![]() But the sad truth is I won't be able to create temp file as well. Am just searching for a solution where I the source file would be untouched, no temp files created and if possible to pass the external dtd as an argument to xmllint. thanks for the reply ! ![]() |
| Sponsored Links | ||
|
|