about describing information; scripting languages and languages for
embedded functionality are software which enables the information to be
manipulated at the user’s end, so these languages do not normally have any
place in an XML ﬁle itself, but in stylesheets like XSL and CSS, and script
XML itself provides a way to deﬁne the markup needed to implement
scripting languages: as a neutral standard it neither encourages nor
discourages their use, and does not favour one language over another, so it
is possible to use XML markup to store the program code, from where it can
be retrieved by (for example) XSLT and re-expressed in a HTML script
Server-side script embedding, like PHP or ASP, can be used with the relevant
server to modify the XML code on the ﬂy, as the document is served, just as
they can with HTML. Authors should be aware, however, that embedding
server-side scripting may mean the ﬁle as stored is not valid XML: it only
becomes valid when processed and served, so care must be taken when
using validating editors or other software to handle or manage such ﬁles. A
better solution may be to use an XML serving solution likeCocoon.
isenclosedinaCDATASectionsothat itdoesn’tget seenasmarkup.
4.7 Can I use Java to create or manage XML ﬁles?
Yes, any programming language can be used to output data from any source
in XML format. There is a growing number of front-ends and back-ends for
programming environments and data management environments to
automate this. Java is just the most popular one at the moment.
There is a large body of middleware (APIs) written in Java and other
languages for managing data either in XML or with XML input or output.
There is a suite of Java tutorials (with source code and explanation) available