Just Another Blog

Are you thinking what I'm thinking?

Saturday, July 24, 2004

XML as a programming language

XML is for data storage and exchange only? No.

Now one can write an application with XML: o:XML. e.g. to generate a RSS feed:

<rss version="2.0">
  <channel>
    <title>Pleasant Pictures</title>
    <link>http://www.o-xml.org/</link>
    <description>An o:XML example.</description>
    <o:import href="lib/io.oml"/>
    <o:set dir="io:File('.')"/>
    <o:for-each name="file" select="$dir.list('*.jpg')">
      <item>
        <title><o:eval select="$file.name()"/></title>
        <link>file://<o:eval select="$file.path()"/></link>
      </item>
    </o:for-each>
  </channel>
</rss>

I think it is quite convenience to code using o:XML for applications that are going to input/output lots of XMLs.

Remember, X is for eXtensibility.

0 Comments:

Note that troll and spam comments will be deleted without any notification.

Post a Comment

<< Home