Docsity

Domain Map Plus Sample XML - Assignment 1 | 021 239, Assignments of School management&administration

Toggle sidebar
bg1
021:239 XML+XSLT for L i b r a r ies
As sign men t 1 : Domai n m ap + sa mpl e X ML
Part%of%working%with%xml%involves%defining%a%scope%and%context%for%the%data%you’re%working%with.%
Choose%some%domain%you%want%to%work%with%‐%it%could%be%a%recipe,%a%poem,%an%email.%The%
domain%itself%doesn’t%have%to%be%text‐based.%It%could%be%a%movie,%something%physical,%like%a%
house,%or%something%more%conceptual,%like%friendship.%It%should%be%something%you%feel%
comfortable%describing.%You’ll%need%to%choose%a%specific%instance%of%your%domain%(for%example,%a%
recipe%for%pancakes)%but%also%be%able%to%generalize%it%(by%describing%the%characteristics%of%recipes%
in%general).%You%can%decide%how%much%to%generalize%it%‐%do%you%want%to%describe%any%type%of%
movie,%or%just%horror%movies,%or%just%the%characteristics%of%really%bad%movies.%You%can%be%
subjective.%Later%on%we’ll%be%more%objective,%or%at%least%we’ll%be%subjective%according%to%existing%
standards%‐%for%now%you%can%be%subjective%to%your%own%standards%if%you%want%to.%
1. Define%the%domain%you%want%to%describe%in%xml%in%a%sentence%or%two.%What%are%the%scope%
and%context?%
2. Map%out%your%domain,%following%the%example%on%the%website.%What%are%the%core%
characteristics%of%the%domain%you’re%interested%in?%Those%are%your%elements.%Elements%
generally%have%thing‐ness,%like%nouns.%Can%you%break%those%elements%down%further%into%
elements%of%their%own%(and%do%you%want%to,%given%how%you%defined%your%domain%in%step%
1)?%
3. Are%there%more%details%you%need%to%describe%and%distinguish%your%elements,%but%that%
don’t%really%stand%on%their%own?%Those%are%your%attributes%‐%add%them%to%your%domain%
map.%They%function%like%adjectives,%closely%associated%with%the%elements%they%describe.%
The%same%attributes%can%be%applied%to%different%elements.%
4. Choose%an%instance%or%embodiment%of%your%domain.%If%you%described%a%newspaper%
article,%choose%a%specific%article%from%The%New%York%Times,%for%example.%%
5. Open%a%new%xml%document%in%oXygen%(uncheck%the%box%that%says%“Use%DTD%or%schema”).%
After%the%xml%processing%instructions%(“<?xml%version="1.0"%encoding="UTF‐8"?>”),%start%
translating%your%domain%to%xml.%%
%
Remember%to%use%opening%and%closing%tags%for%every%element.%
%
<element%attribute=”value”>data</element>%
%
Elements%that%conceptually%make%up%other%elements%should%be%nested,%such%as:%
%
<family>%
% <parent></parent>%
% <child></child>%
% <pets>%
% % <dog></dog>%
% % <cat></cat>%
% </pets>%
</family>%
pf2

Partial preview of the text

Download Domain Map Plus Sample XML - Assignment 1 | 021 239 and more Assignments School management&administration in PDF only on Docsity!

021:239 XML+XSLT for Libraries

Assignment 1: Domain map + sample XML

Part of working with xml involves defining a scope and context for the data you’re working with. Choose some domain you want to work with ‐ it could be a recipe, a poem, an email. The domain itself doesn’t have to be text‐based. It could be a movie, something physical, like a house, or something more conceptual, like friendship. It should be something you feel comfortable describing. You’ll need to choose a specific instance of your domain (for example, a recipe for pancakes) but also be able to generalize it (by describing the characteristics of recipes in general). You can decide how much to generalize it ‐ do you want to describe any type of movie, or just horror movies, or just the characteristics of really bad movies. You can be subjective. Later on we’ll be more objective, or at least we’ll be subjective according to existing standards ‐ for now you can be subjective to your own standards if you want to.

  1. Define the domain you want to describe in xml in a sentence or two. What are the scope and context?
  2. Map out your domain, following the example on the website. What are the core characteristics of the domain you’re interested in? Those are your elements. Elements generally have thing‐ness, like nouns. Can you break those elements down further into elements of their own (and do you want to, given how you defined your domain in step 1)?
  3. Are there more details you need to describe and distinguish your elements, but that don’t really stand on their own? Those are your attributes ‐ add them to your domain map. They function like adjectives, closely associated with the elements they describe. The same attributes can be applied to different elements.
  4. Choose an instance or embodiment of your domain. If you described a newspaper article, choose a specific article from The New York Times, for example.
  5. Open a new xml document in oXygen (uncheck the box that says “Use DTD or schema”). After the xml processing instructions (“”), start translating your domain to xml. Remember to use opening and closing tags for every element. data Elements that conceptually make up other elements should be nested, such as:
  1. When you are done, save it as an .xml file. Bring your description, domain map, and your xml document to Thursday’s class (6/11/09).