The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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 !!

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-08-2008
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,932
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
  #2 (permalink)  
Old 04-09-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,643
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">
Right? Are you not allowed to add this?
  #3 (permalink)  
Old 04-10-2008
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,932
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
or

Code:
xmllint --noout --dtdattr file.xml
it works perfectly as expected

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
  #4 (permalink)  
Old 04-10-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,643
I must be missing something --dtdattr <external DTD resource file>
does not work? Kinda like telling xmllint to use what amounts to an externally defined schema?
  #5 (permalink)  
Old 04-10-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
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.)
  #6 (permalink)  
Old 04-11-2008
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,932
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 04:27 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0