[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OT XML query was Re: [StrongED] Re: StrongED Instructions



On 2017-12-18 12:16, Brian Jordan wrote:
In article <e59a03e2064d10a2149f502b911e844c@xxxxxxxxxxxxxxxxxxxx>,
   Jeremy Nicoll - ml sed <jn.ml.sed45@xxxxxxxxxxxxxxxxxxxx> wrote:

[Snip comprehensive description of XML - Thank you}

<intrigued>
I get, admittedly at a superficial level and worthy of more research, how
XML is written and that the information held in an XML file can be used
in many applications and in many ways. I seem to have missed the bit
about how this is used; do applications have internal XML parsers to
access the data and decode the tagging or is this a search and replace
exercise in a text editor?
</intrigued>

If an application uses XML files to store (say) its configuration data
in, then the program probably uses pre-written programming tools that
readily allow generation of and processing of the files.

So for example if you were writing a program in Python or perl or C or
C++ ... you would include within it the support already written in a
Python or perl or C or C++ - compliant manner for handling such files.

You might for example see that a program was built with, or linked with,
'libxml2'. libxml2 would provide a standard set of programmers' tools for
manipulating XML data in a general way.  The programmer using the tools
wouldn't have to write an XML parser from scratch.  Likewise there's a
libxslt which provides facilites for using XSLT stylesheets.



For standalone use, like what's being discussed here, there are standalone programs which can be pointed at XML files, plus 'stylesheets' (which are
documents describing how an XML file should be automatically transformed
to produce specific kinds of output), and also the DTDs or Schemas (which
are files which describe in detail how the parsers should actually read
the XML data).


It's all quite hard to describe.  If you look at the transformation
examples at: https://en.wikipedia.org/wiki/XSLT   you'll more than
likely think the XSLT syntax is obscure and long-winded, and harder
to understand than the XML, and what's the point...   What's not so
obvious in the examples where a short piece of XML is transformed
into a different piece of XML, or HTML, is that once someone has
defined suitable XSLT, it can be pointed at millions of lines of
XML source and make the same corresponding transformation, into a new
set of millions of lines of output.

I've never actually done it, and I'm sure that like any technique,
writing the XSLT and DTD parts needs practice, but the tools that
apply these are widely used in computing.

--
Jeremy Nicoll - my opinions are my own

--
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxx
List archives at http://diy.Torrens.org/RO/StrongED/index.html