From: carp __ Date: 2007-04-25T19:01:54+09:00 Subject: Re: REXML + DTD example Clifford Heath wrote: > RexML can't do external DTDs, and the author told me it won't ever, > as he believes that the syntax is too evil to even contemplate. > > When I needed to do it, on Windows systems having cygwin installed, > I just opened the XML file using a pipe from xmllint, which was > launched with the right parameters to make it expand the entities > from an external DTD. The main awkwardness comes from the fact that > xmllint looks for unqualified DTD files in the same directory as > the XML file, so you need to extract the directory pathname from > the file's basename and cd to that directory first: > > cmd = "sh -c 'cd #{dir}; xmllint --loaddtd --noent - <#{base}'" > infile = popen(cmd) > Thanks for that hint, Clifford. I did it with xmllint now - a bit ugly as it makes the script less portable, but well ... better than nothing I guess. Thanks again! -carp -- Posted via http://www.ruby-forum.com/.