Log in

Because my SQL blog will never have many readers, and I had to create… - John [entries|archive|friends|userinfo]

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

[Sep. 26th, 2015|09:55 am]
Because my SQL blog will never have many readers, and I had to create this entire XML block just to get this one blasted joke out of my head....

(NB: it only makes sense if you've seen (or learned the joke within) a particular Babylon 5 episode)

(from the middle of the post, I continue):
To expand upon this:
<?xml version="1.0"?>
<PPG type="resin_sculpture">
<Bear type="Teddy">
<Desc>JS embroidered shirt</Desc>
<Desc>Posable 'action' figure </Desc>

Notice that we start and end with "Memorobilia", and that everything we've collected is categorized as B5 (for Babylon 5, a darn good science fiction TV series). We could have eliminated either tag - but by enclosing the B5 tags in Memorobilia tags, we have room to add other forms of memorobilia. Sorry: Memorobilia. XML is case sensitive! And if we want to add this to other collectibles that aren't exactly Memorobilia, we can enclose this entire structure within a new set of tags. That's one of the neat things about XML.

This isn't the best, most well designed XML schema, but it's enough to do some basic understanding. Notice, interestingly, that there's little actual text data in here! But that's perfectly reasonable - as with the car example above (ED: where we categorize a Car, then a Make, then a Model), we don't necesssarily need text if we have the right categorizations.

You can also see that some of the data is included, not by tagging/categorization, but by attibutes - we can mention that it's a "Teddy" bear by throwing in an attribute on the Bear (in case there's a posable bear, or a statue of a bear), while noting that the Londo figure, of all the Souvenir "children", has no attributes.