[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XML should NOT be a new programming language

if else in xml
> Why do we use XML to validate, manipulate, transform etc. other XML
> documents, fragments?
> I want to do my work in Java or another language, not a XML
> "language"
> like XSLT, XML Schema etc. The XML "languages" contains a lot
> of noise
> and duplicated information. Just try build a fairly large XSL
> stylesheet, an it will fast be hard to read. My favorite IDE do not
> support manipulating XML documents.

It's certainly true that using XML syntax for things like stylesheets has
its disadvantages. The reason the designers chose this approach include:

(a) many stylesheets consist of 75% templates for the output document, 25%
processing logic. Writing the template for the output document in XML is
very natural; it also means a stylesheet can easily be created from examples
of the required output document, by adding the processing code once the
output has been designed.

(b) it's extremely common in complex processing environments to write XSLT
transformations that take stylesheets as their input or output.

(c) it avoided the need to invent a new set of lexical conventions for
handling extended character sets, file inclusions, etc.

(d) it allows stylesheets to be easily embedded within other XML documents.

The designers of XQuery took your view that the clumsiness of an XML
representation outweighed these advantages. Many people have criticised them
for this.

Meanwhile Paul Tchistopolskii has developed a way of writing XSLT
stylesheets in non-XML notation: see
http://www.pault.com/pault/prod/XSLScript. So you can take your pick.

Michael Kay
Software AG
home: Michael.H.Kay@n...
work: Michael.Kay@s...

> We have Java, C++ etc. We have if-else, while, switch etc. We can do
> classes, compile ......... We don't we use them??
> To me XML should be a part of my chosen programming language. No only
> files on a network or filesystem.
> I want XML in Java! Why not like this:
> Stylesheet style = {
>          <XSL:STYLESHEET {
>                  [xmlns.xsl = "http://www.w3.org/1999/XSL/Transform"]
>                  [version = "1.0"]
>                  // Book
>                  <XSL:TEMPLATES {
>                          [match = "Book"]
>                          <HTML {
>                                  <HEAD {
>                                          <TITLE {
> name.equals("") ? "Hej,
> Guest!" : "Hej, " + name +"!";
>                                          }
>                                  }
>                                  <BODY {
>                                          <CENTER {
>                                                  <XSL:TEMPLATES
> { [select="title"] }
>                                          }
>                                                  <XSL:TEMPLATES
> { [select="chapter"] }
>                                                  <XSL:TEMPLATES
> { [select="appendix"] }
>                                  }
>                          }
>                  }
>          }
> } // stylesheet
> I use Apples Project Builder, and the indenting works
> perfectly, for the
> code above!
> Niels Peter
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> The list archives are at http://lists.xml.org/archives/xml-dev/
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.