I'm running a Django site with XML text stored in
TextField properties. It's stored as XML rather than plain text because it's heavily annotated with information about the underlying manuscript, such as abbreviations and symbols. Here's an example:
class Entry(models.Model): # Name and description. chapter = models.ForeignKey(Chapter) latin_text = models.TextField()
Here's an example of the content of
<initial type="2">I</initial>n <place type="0"><span>Ricmond</span></place> ten<abbr type="1">et</abbr> aeccl<abbr type="0">esi</abbr>a de Cietriz .ii. hid<abbr type="0">as</abbr>.
I'd now like to start displaying that XML text on my HTML pages.
I know I can display raw XML by dropping it into a
textarea: the issue is that I'd like to display it in a more beautiful way, with:
- styling (all the
abbrelements in italics, the
placeelement in bold)
place, show a pop-up explanation)
I'm not sure if XSLT can do what I need, or even if it can be used alongside HTML. So my question is:
- Should I transform the XML into HTML before adding it to the Django database?
Not familiar with Django but maybe check this answer out : Can I use XSLT in Django?