commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <>
Subject RE: [CLI] XML -> CLI (was Re: Three month contribution to Commons ?)
Date Fri, 08 Aug 2003 16:12:40 GMT

My thought was for an xml2cli dev-time mechanism.

At dev-time, I create an XML file, run an xlat tool that creates a Java
class using CLI. The class has a nice Javadoc of course. Internally, maybe
the tool runs one xlat to gen the CLI code, and a second to gen the Javadoc.
Maybe there is also a gen-an-HTML-doc-page option...

Here is a quick and very dirty XSD based on what CLI 1.0 looks like:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs=""
elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:element name="cli">
            <xs:documentation>Comment describing your root
                <xs:element ref="option"/>
                <xs:element name="optionGroup">
                            <xs:element ref="option"/>
    <xs:element name="option">
            <xs:attribute name="longName" type="xs:NCName"/>
            <xs:attribute name="type" type="xs:Name" use="optional"
            <xs:attribute name="help" type="xs:normalizedString"
            <xs:attribute name="shortName" type="xs:NCName"/>
            <xs:attribute name="argName" type="xs:normalizedString"
            <xs:attribute name="argCount" type="xs:byte" use="optional"
            <xs:attribute name="argOptional" type="xs:boolean"
use="optional" default="false"/>
            <xs:attribute name="valueSeparator" type="xs:NCName"

With a dummy auto-generated example:

<?xml version="1.0" encoding="UTF-8"?>
<cli xmlns:xsi=""
xsi:noNamespaceSchemaLocation="C:\Documents and Settings\ggregory\My
    <option longName="NCName" type="xs:string" help="normalizedString"
shortName="NCName" argName="normalizedString" argCount="1"
argOptional="false" valueSeparator="NCName"/>
        <option longName="NCName" type="xs:string" help="normalizedString"
shortName="NCName" argName="normalizedString" argCount="1"
argOptional="false" valueSeparator="NCName"/>

-----Original Message-----
From: Rob Oxspring [] 
Sent: Friday, August 08, 2003 05:41
To: Jakarta Commons Developers List
Subject: [CLI] XML -> CLI (was Re: Three month contribution to Commons?)

There has been talk on a few occasions that there should be a way to get
build a CLI interface from an XML definition but this is
the first time I've thought about it in any detail.  I'd always figured that
the xml->cli transformation would take place at runtime
but the comment from Gary seems to suggest otherwise.  So what do people
have in mind?

Is the xml2cli transformation people are thinking of a compile-time or
runtime operation?

What sort of functionality should be produced by the transformation? - would
the transformed code just present a CommandLine object
for the client code to query or would the code call specified methods on the
client code?

Does anyone have an example of the sort of xml fragment they might expect to

I mainly just want to ponder briefly about what would be needed by the core
API and see if my cli2 proposal will be able to cope.
(I'm aiming to have a new drop of my proposal ready sometime over the
weekend so I'll let people play with the new ideas and pass
comment then).


----- Original Message ----- 
From: "Gary Gregory" <>
To: "'Jakarta Commons Developers List'" <>;
Sent: Thursday, August 07, 2003 7:26 PM
Subject: RE: Three month contribution to Commons?

> As you mentioned CLI, if you look at CLI messages yesterday or the day
> before on this list you'll see that there is a CLI 2.0 in the works but it
> seems that there are two main branches and approaches. I have not done
> deep in CLI but I use it (version 1.0).
> Perhaps there is something there for you to do? Perhaps the two authors of
> CLI branches would like to comment or get help from you?
> From my end, one thing I would like a future CLI to be able to do is to
> define a CLI from an XML file such that CLI can generate Java code,
> and HTML docs. But I'm just dreamin' here... ;-)
> Gary

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message