The Dopefly Tech Blog

« The Dopefly Tech Blog Main page

Fusebox 4.1 DTDs (and how to use them!)

posted under category: Fusebox on November 17, 2005 by Nathan

Another thing I've been playing with lately is getting tag insight (you know, those little drop-downs while you type) to work on fusebox.xml and circuit.xml files. I'm no kind of Eclipse hacker, so the easy way to do it is make a DTD file for the XML editor you may already have in Eclipse.

Mmmkay... how does that help me? Glad you asked!

First, do you have an XML editor? You'll need one for this exercise. I prefer the WST XML editor from the Eclipse org., and it's easy for you to get. Go to your auto-update tool (under the help menu), and search the Eclipse update site for new plugins. Locate the WST (Web Standards Tools), select it and hit the 'select required' button. Now install and restart.

Next, you need to add the DTDs to the local DTD registry. What I did was hit the Eclipse prefs, and found the XML Catalog section under Web and XML. Then I added 2 user specified entries, for fusebox.xml and circuit.xml, pointed them to the appropriate DTD file on my local disk, made them a Public ID key type and gave the key a name (I used circuit.dtd and fusebox.dtd).

Next, in my XML files, I added this doctype to my circuits:
<!DOCTYPE fusebox:circuit PUBLIC "circuit.dtd" "circuit.dtd">
And to my Fusebox.xml:
<!DOCTYPE fusebox PUBLIC "fusebox.dtd" "fusebox.dtd">
I wish I knew what that all meant, but i'm ignorant out of lack for good books and time to read them ;)

And there it is. Restart Eclipse (for good measure) and it should all just work!
All you need is the DTDs to try it yourself, so here you go:

Fusebox 4.1 Document Type Definitions

These were copied and modified from the ones by Sandy Clark - Sandy, hope you don't mind. Good work getting it started, thanks!

Hope you all like. Let me know if any of you have any updates to these, as it's my first real stab at DTDs.

Nathan is a software developer at The Boeing Company in Charleston, SC. He is essentially a big programming nerd. Really, you could say that makes him a nerd among nerds. Aside from making software for the web, he plays with tech toys and likes to think about programming's big picture while speaking at conferences and generally impressing people with massive nerdiness and straight-faced sarcastic humor. Nathan got his programming start writing batch files in DOS. It should go without saying, but these thought and opinions have nothing to do with Boeing in any way.
This blog is also available as an RSS 2.0 feed. Click your heels together and click here to contact Nathan.