This script downloads the definitions of XML entities from
http://www.w3.org/2003/entities/iso9573-2003/ or from whatever
address you give it as an argument. The argument should be
an URL (that LWP::UserAgent::get can access) pointing to a document
with (absolute or relative) references to files ending with the
.ent suffix. These files are expected to be DTDs with
<!ENTITY amp "&" >
The script parses these files and prints the perl module to the
standard output. If you wish, you can give file as another
argument to the script and it will then print it to file.
You can also specify the output file in the environment variable
The index and the output file are distinguished by the presence
of :// substring.
If you want to use a locally stored index file (the one with the
.ent references), you can access it by saying
perl download.pl file:///path/to/index.html
Note that the script currently distinguishes between relative
and absolute paths by looking at whether the href contains a ://
substring. This can lead to crashes when the links look like
Also, the script assumes the links have exactly the format
href=... - with double quotes.