OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   [XNP] XML Native Programming

[ Lists Home | Date Index | Thread Index ]

This topic is hardly never tackled here or elsewhere ; I'm not sure that 
people are interesting with it.

I thought about XNP when I've had to deal with a complex XML 
configuration file that I used to drive my processes with declarative 
Declarative sentences are very concise and expressive (they express 
whatever you want), so an application looks like :


anyway, it is not really tunable, so let's add some more parameters :

<doIt param="likeThis"/>

so, we can add attributes and sub-elements and so-on ; however, we are 
limited in expressiveness by complexity : there is always a mean to add 
more tags but we are telling to stop when the document became hard to 
understand/read/maintain : it's just a configuration file !
Assume that I can express :
and that I can also express :
but in a certain case, i'd like to express :
     <inThisCase how="likeThis">
     <inThisCase how="notLikeThis">
but what I'm really interest in is not <inThisCase> but <likeThis> or 
<likeThat> ; by adding the new element, I increase the complexity of my 
document, and put off the same (recursive) problem...

there's another way to solve this problem :
-focus on basic features (<doIt>, <likeThis>, <likeThat>)
-delegate things that looks like alternatives to an imperative language 

this implies that :
-my specific features are grouping together (in XML, grouping is done 
with namespaces)
-they can be mix with procedure-oriented actions
-a data model is needed
-interaction with the environment is needed (system, I/O...)

     <xcl:if test="...">
     <xcl:if test="...">

I just reinvent the "if" statement ; even in the XML world, people 
already use it : look at XSLT, that also mixes some declaration 
sentences (<xsl:template>) with procedure-oriented statements (<xsl:if>) 
; however, there's not an obvious way to extend XSLT with foreign 
vocabularies (XSLT was not design for that purpose, even if the 
extension mechanism may be useful in some rare case)

xcl stands for XML Control Language, and is bound to the "right" 
namespace URI : it contains tags that allow loops, data assignation, etc...
the app prefix is bound to my application, that do what I expect (I hope)

Isn't that a way to build my application with components ?

I don't talk about taglibs in JSP, for example, because they are focused 
on web problematics. A tool such as Ant focused on Java problematics

I found on the web some XNP tentative : water, SSML, PIA, DXP, XFA...
all focused on a single grammar (which is often based on imperative 
languages), but none thought about mixing declarative sentences with 
procedure oriented sentences

I think that a good framework for XNP should define :
-core libraries such as xcl, I/O, system, RDBMS...
-a way to define custom libraries such as my "app"
-a data model
-a mean to deal with data types (XML or not)

Perspectives :
an example that could be real : a schema (that i won't share) that draws 
up a list of values available in an attribute with SQL

here is a snippet code that mixes Relax NG tags with SQL and xcl :

<attribute name="product">
     <rdbms:connect db='products-db' driver='...' host='...' 
name='products-db' passwd='...' user='...'/>
     <rdbms:select connexion='{$products-db}' name='products'
  query='SELECT * FROM orders WHERE id={@category}'/>
         <xcl:for-each name='product' select='{$products}'>

Is there anybody interested in such a framework ?
(I will publish mine soon)

           (. .)
|   Philippe Poulard    |


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS