Importing XML glossary with HTML tags fails

Importing XML glossary with HTML tags fails

by Bill Jones -
Number of replies: 2
Hello,

I'm trying to import a modified XML file into a glossary with HTML coding inside the <definition> tags and it keeps failing.  The XML file I use it attached.  What happens is it imports the one entry but the contents of the <description> tag gets dropped and the word "Array" gets put in its place. 

I logged in as "Demo Teacher" on the "Playground" demo course on the Moodle server (http://moodle.org/mod/glossary/view.php?id=6378) and was able to reproduce the error. 

I modified the file in Jedit, but the encoding was set to UTF-8 and it should auto-detect that from the xml header anyway.  Thoughts?

Thanks,
Bill Jones
Augsburg College
jonesw@augsburg.edu
Average of ratings: -
In reply to Bill Jones

Re: Importing XML glossary with HTML tags fails

by Dan Stowell -
You must not use "raw" HTML tags. Instead you should use "entity-encoded" HTML tags. Convert "<" to "&lt;" and convert ">" to "&gt;"

For example,

<p>This paragraph is raw HTML</p>

&lt;p&gt;This paragraph has been entity-encoded&lt;/p&gt;

This "hides" the HTML tags from the XML structure of the document.
In reply to Dan Stowell

Re: Importing XML glossary with HTML tags fails

by Bill Jones -
Dan,

Thanks for your message.  I tried the tag replacements on a short test entry and it worked, but on a much longer piece of text with many tags it didn't.  I need to set it aside for a few days before I can troubleshoot more, but your suggestion was fruitful.  Thanks.

Bill J.