Syntax draft (DTD)

Loïc Péron loic.peron at bigfoot.com
Wed Apr 3 08:17:26 PST 2002


Hi all,

Here is my little contribution to alfs:
a DTD greatly inspired from ANT's way of
doing things. It can surely be extended
and improved, but it is the way I think
I would like to write an alfs profile.

Waiting for your comments ... (positive
or negative, I don't care untill it is
constructive and makes me learn :-)

-- 
Loïc Péron

phone:(33) 683 880 177
mailto:loic.peron at bigfoot.com
-------------- next part --------------

<!--

  ALFS syntax draft
  v 0.1
  Loïc Péron

  -->

<!-- attribute types -->
<!ENTITY % Name         "CDATA">
<!ENTITY % Version      "CDATA">
<!ENTITY % Id           "ID">
<!ENTITY % IdList       "IDREFS">
<!ENTITY % User         "CDATA">
<!ENTITY % Group        "CDATA">
<!ENTITY % Directory    "CDATA">
<!ENTITY % Boolean      "(yes|no)">
<!ENTITY % File         "CDATA">
<!ENTITY % Command      "CDATA">
<!ENTITY % LinkType     "(soft|hard)">
<!ENTITY % ArgDash      "(none|simple|double)">

<!-- tasks -->
<!ENTITY % tasks        "%simpletasks;|%complextasks;">
<!ENTITY % simpletasks  "create|copy|move|remove|link|permissions">
<!ENTITY % complextasks "execute|configure|make|patch|unpack|textdump">

<!-- files -->
<!ENTITY % fileset      "(file|dir)+">

<!-- alfs profile -->
<!ELEMENT alfs (block)*>
<!ATTLIST alfs
  name      %Name;      #REQUIRED
  version   %Version;   #IMPLIED
>

<!-- grouping element -->
<!ELEMENT block (env*, (block|%tasks;)*)>
<!ATTLIST block
  name      %Name;      #REQUIRED
  id        %Id;        #IMPLIED
  depends   %IdList;    #IMPLIED
  version   %Version;   #IMPLIED
  user      %User;      #IMPLIED
  group     %Group;     #IMPLIED
  basedir   %Directory; #IMPLIED
  clearenv  %Boolean;   "no"
>

<!-- environment variable -->
<!ELEMENT env EMPTY>
<!ATTLIST env
  name      %Name;      #REQUIRED
  value     %Value;     #REQUIRED
>

<!-- generic parametrized task -->
<!ELEMENT execute (env|param|option)*>
<!ATTLIST execute
  basedir   %Directory; #REQUIRED
  command   %Command;   #REQUIRED
  argdash   %ArgDash;   "simple"
  canfail   %Boolean;   "no"
>

<!-- parameter defined with name and value -->
<!ELEMENT param EMPTY>
<!ATTLIST param
  name      %Name;      #REQUIRED
  value     %Value;     #REQUIRED
>

<!-- option defined by name -->
<!ELEMENT option EMPTY>
<!ATTLIST option
  value     %Name;      #REQUIRED
>

<!-- configuration -->
<!ELEMENT configure (env|param|option)*>
<!ATTLIST configure
  basedir   %Directory; #REQUIRED
>

<!-- build -->
<!ELEMENT make (env|param|option)*>
<!ATTLIST make
  basedir   %Directory; #REQUIRED
>

<!-- patch -->
<!ELEMENT patch (param|option)*>
<!ATTLIST patch
  basedir   %Directory; #REQUIRED
  file      %File;      #REQUIRED
>

<!-- directories and empty files creation -->
<!ELEMENT create (%fileset;)>
<!ATTLIST create
  basedir   %Directory; #IMPLIED
>

<!-- single file -->
<!ELEMENT file EMPTY>
<!ATTLIST file
  name      %File;      #REQUIRED
>

<!-- directory -->
<!ELEMENT dir (dir)*>
<!ATTLIST dir
  name      %Directory; #REQUIRED
  recurse   %Boolean;   "no"
>

<!-- unpack -->
<!ELEMENT unpack (%fileset;)>
<!ATTLIST unpack
  basedir   %Directory; #REQUIRED
>

<!-- copy -->
<!ELEMENT copy (%fileset;)>
<!ATTLIST copy
  dir       %Directory; #REQUIRED
  overwrite %Boolean;   "no"
>

<!-- move -->
<!ELEMENT move (%fileset;)>
<!ATTLIST move
  dir       %Directory; #REQUIRED
  overwrite %Boolean;   "no"
>

<!-- delete -->
<!ELEMENT remove (%fileset;)>

<!-- link -->
<!ELEMENT link (%fileset;)>
<!ATTLIST link
  basedir   %Directory; #REQUIRED
  name      %Name;      #IMPLIED
  type      %LinkType;  "soft"
>

<!-- rights -->
<!ELEMENT permissions (rights*, %fileset;)>

<!ELEMENT rights EMPTY>
<!ATTLIST rights
  user      %User;      #REQUIRED
  right     %Right;     #REQUIRED
  remove    %Boolean;   "no"
>

<!-- output content to file -->
<!ELEMENT textdump (#CDATA)>
<!ATTLIST textdump
  file      %File;      #REQUIRED
  append    %Boolean;   "no"
>



More information about the alfs-discuss mailing list