I am trying to export a glossary into MSWord. I cannot get it to stop showing XML tags. We’re using Moodle 1.9. Any help is appreciated. Thanks!
Of course, I tried various web-based solutions to no avail. Then, I remembered that I had access to another operating system aside from Mac or Windows to work with–GNU/Linux. So, I started searching on these terms: “converting xml to rtf doc linux”
The search yielded a command line program called “
Pandoc.” I quickly created a “
persistent” bootable USB flash drive for my new favorite light-weight distro,
Peppermint ICE (which was a learning experience that I’ll detail in
another blog entry).
I installed the program with sudo apt-get install pandoc and let it go. Once the program was installed, I used the following command to convert the XML file from a Moodle Glossary to a Rich Text Format (RTF) file:
pandoc -o output.rtf glossary.xml
And, the result was a file that stripped out MOST of the yucky code…of course, the text wasn’t pretty, as you can see from the excerpt below:
Windows Terms Windows is the operating system on our PC platform computers. The operating system is the interface between users and computer hardware. 0 dictionary 1 1 1 0 1 1 0 10 Windows (trademark) an operating system with a graphical user interface. Windows is the system software that runs the computer. Windows works between the hardware and the user to accomplish tasks on the computer system. 1 0 0 0 1 Folder A virtual container within a digital file system, in which groups of computer files and other folders can be kept and organized.
Still, that’s a big improvement over the XML code. I opened the RTF file in Abiword (my favorite small word processor) and saved the file as an MS Word DOC file, then emailed it to the person with the question.
Note: You can find additional Glossary ideas online at MoodleMayhem.org
Somehow, I still feel that this could have been done in a better way. In this case, better would involve cleaner formatting of the text. If you know of one, please let me know!
Get Blog Updates via Email!
Enter your email address:
Delivered by FeedBurner

pingthis();
Everything posted on Miguel Guhlin’s blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients.
Read Full Disclosure
Nice article about Converting a #Moodle Glossary from XML to RTF or MS Word DOC format.Thank You.
Nice article about Converting a #Moodle Glossary from XML to RTF or MS Word DOC format.Thank You.
Thanks Miguel, for the help on the glossary conversion. I got it cleaned up and added form fields in Word and its ready to go. I am with you though, I think there's a cleaner way. In the 1.8 version of Moodle I think there were options at the bottom of the page after clicking export in the glossary. But nothing in 1.9…
Thanks Miguel, for the help on the glossary conversion. I got it cleaned up and added form fields in Word and its ready to go. I am with you though, I think there's a cleaner way. In the 1.8 version of Moodle I think there were options at the bottom of the page after clicking export in the glossary. But nothing in 1.9…