November 2012 Archives

Another view of XML schema attributes vs. elements

Another way to look at whether you should add information as an attribute or a child element while designing an XML schema element is whether you are talking about an IS-A or a HAS-A relationship.

Attributes are great for IS-A relationships -- "I am an element with ID='20121101-i1' or "I am an element for the Dublin Core (METS MDTYPE='DC')".

Child elements are great for HAS-A relationships -- "I have several groups of files" or "I have binary and XML data for a file".

When to create a branch in Git?

Upon reflection:

$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 297 commits.

I think maybe I should have created a branch…

About Mark Leighton Fisher

user-pic Perl/CPAN user since 1992.