[ANSTHRLD] Somewhat OT: Tech Help (XML files)

Tim McDaniel tmcd at panix.com
Wed May 18 13:57:47 PDT 2011


On Wed, 18 May 2011, Joseph Percer <jpercer at gmail.com> wrote:
> Sadly, I cannot figure out how to open and read the downloaded
> files, which are marked up using an XML document. Can someone direct
> me how to read XML marked up data? Opening the file in a web browser
> just shows the markup language and not what I'm actually after.
>
> The source is located at: http://ota.oucs.ox.ac.uk/headers/1685.xml

XML is purely an encoding of data in a machine-readable form.  XML
provides no formatting or meaning for anything in it.

For example,
     <person>
         <givenName>Tim</givenName>
         <surname>McDaniel</surname>
         <email>tmcd at panix.com</email>
     </person>

is a valid fragment of XML.  All it's expressing is that there's an
instance of an object called "person", and there are three data that
it contains, and names each datum and provides its value.  It says
nothing about how it ought to be displayed on a screen, in a browser,
or whatever.  I chose "person", "givenName", "surname", and "email" as
object instances.  There is no central repository of meaning or
elements.   You can choose whatever elements you like and ascribe such
structure and meaning as you like.

So asking about how to read an XML data file is like asking how to
read a column of numbers.  The meaning of the data is provided by an
outside source, and it's up to you to grok it or display it in ways
that are useful to you.

There's a programming language called XSLT that can transform XML into
different XML.  Once you've learned XSLT, you could write code to
produce XML that happens to be valid HTML.  (Depending on how familiar
with programming you are and how complicated the XML is, that could
take hours to weeks.)  But that's like taking a column of numbers and
deciding to make a bar chart out of them: it's how you decided to
represent it.

Danett Lincoln
-- 
Tim McDaniel, tmcd at panix.com



More information about the Heralds mailing list