?

Log in

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

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

[Sep. 26th, 2015|09:55 am]
John
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"?>
<Memorobilia>
<B5>
<Weapon>
<PPG type="resin_sculpture">
<Quantity>4</Quantity>
</PPG>
</Weapon>
<Souvenir>
<Bear type="Teddy">
<Desc>JS embroidered shirt</Desc>
<Quantity>2</Quantity>
</Bear>
<Londo_Mollari_Figure>
<Quantity>1</Quantity>
<Desc>Posable 'action' figure </Desc>
</Londo_Mollari_Figure>
</Souvenir>
</B5>
</Memorobilia>

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.

linkReply