XSLT .dug Exporter

XSLT .dug Exporter

In our language-learning program at Coccinella, 3DLanguage, we had a custom format for the "conversation" files, called .dug for fun because the head programmer's name was Doug.  A .dug file was divided into sections such as the user's phrases, the character's phrases, the audio files, etc.  Each section was a list of comma-separated values, including relationship values specifying which elements in other sections this entry relates to.

Here's a truncated version of what part of a .dug file might look like:

# Character Dialog
# Format: Label:Dialog:Player Responses:Action:Audio:Audio Parts:Help Labels

ci1:Hola.|:u1:NONE:a54:a146,NONE:h11
cit1:Hello.
cip1:oh-lah
c2:¿Como|estás?:u2,u3:NONE:a41:a136,a141:h4,h7
ct2:How are you?
cp2:koh-moh eh-stahs

# User Dialog

u1:Hola.|:c2:NONE:a100:a192:h11
ut1:Hello.
up1:oh-lah
u2:Muy|bien|gracias.:c3:NONE:a113:a206,a172,a189:h16,h3,h9
ut2:Very good, thanks.
up2:mwee byen grah-see-ahs

We had a proprietary authoring tool that was functional but needed usability improvement.  Instead of re-inventing the wheel, I thought we could use something existing to output these files.  I found a cool program called FreeMind that lets you map out your data in a tree format, which was perfect for our branching conversations.  It saves its files as XML files.  They look something like this:

<node id="Freemind_Link_1937407224" style="" text="Hello.\\nHola.">
<node id="Freemind_Link_1701811544" style="" text="Hello. I need some help.\\nHola. Yo necesito ayuda.">
<node id="Freemind_Link_531079719" style="" text="My head hurts.">
<arrowlink destination="Freemind_Link_1155377786" id="Freemind_Arrow_Link_1599570372"></arrowlink>
...
</node>
</node>
</node>

The other nice thing about freemind was that it allows you to make custom exporters using XSLT to translate the data into another format.  So I set out to do just that.  I taught myself XSLT for this project, and even dipped into a little java to add my own menu item and keyboard shortcut for my exporter.

This isn't strictly web-related, except for the fact that XSLT can be useful for web applications that involve XML data.  While I haven't delved into any such depth on the web just yet, after this experience I feel sure that I could.


The other nice thing about freemind was that it allows you to make custom exporters using XSLT to translate the data into another format.  So I set out to do just that.  I taught myself XSLT for this project, and even dipped into a little java to add my own menu item and keyboard shortcut for my exporter.

This isn't strictly web-related, except for the fact that XSLT can be useful for web applications that involve XML data.  While I haven't delved into any such depth on the web just yet, after this experience I feel sure that I could.