]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xul/staff_client/external/dtd2js.pl
handle different quotes and empty strings
[Evergreen.git] / Open-ILS / xul / staff_client / external / dtd2js.pl
1 #!/usr/bin/perl
2 #<!ENTITY common.title "Title">
3 #<!ENTITY common.author "Author">
4 #<!ENTITY common.subject "Subject">
5 #<!ENTITY common.series "Series">
6 #<!ENTITY common.keyword "Keyword">
7 #<!ENTITY common.type "Type">
8
9 print "var entities = {};";
10 while( $line = <> ) {
11
12         if ($line =~ /<!ENTITY\s+(\S+)\s+(["'].*["'])\s*>/) {
13                 print "entities['$1'] = $2;\n"; 
14         } else {
15                 print STDERR "Problem with: $line";
16         }
17 }