Conventions

1. File naming convention

1.

File naming convention

Stefano Mazzocchi


XSLT is able to perform all a bunch of file format
transformations, but people usually use the ".xsl" extention
for the xsl transformation sheets.

For some samples, I came out with a very simple "design
pattern" for extended file extentions that works like this:

  hello.xml

  hello.html.xsl
  hello.wml.xsl
  hello.vml.xsl
  hello.svg.xsl
  hello.fo.xsl
  hello.vrml.xsl
  hello.x3d.xsl

see the pattern? A more generalized pattern is
 
  wd-xslt.spec.xml

  users.spec.html.xsl
  developers.spec.html.xsl
  simple.spec.fo.xml
  fancy.spec.fo.xml

In general, the XfeX pattern works like this

  filename[.doctype].xml
  filename[.input_doctype][.output_format].xsl

where

  doctype := document root element
  input_doctype := input document root element
  output_format := the output format

Problems:

1) two different DTDs may share the same root element, thus
breaking the whole deal. Since namespace syntax is not
allowed in file name (":" is an illegal char on many
file systems) and full URL expansion is impractical,
it's up to the writer to find matching unique names for
the "doctype" and "input_doctype"
identifiers.

2) the output format is not directly related to the
xsl:output element.  In fact, FO, SVG, WML, VML and X3D are
all valid XML formats, and they share the same output
handler. So, the "output_format" identifier is the
key to a map like this

  html -> ("html", "-//W3C//DTD HTML 4.0//EN")
  wml  -> ("xml", "-//WAPFORUM//DTD WML 1.1//EN")
  vml  -> ("xml", "...")
  fo   -> ("xml", "...")
  svg  -> ("xml", "...")
  x3d  -> ("xml", "...")
  vrml -> ("text", "...")
  css  -> ("text", "...")
  csv  -> ("text", "...")
  and so on

(where the "..." stand for the formal public identifiers or,
if not available, some unique identifiers)

What do you think?

(don't want to impose this to anyone, but I'm trying to come
up with a general file naming pattern that we can use
extensively at least between the Apache XML projects to
simplify file management.

I wonder if it might be clearer if a different delimiter was used.


Choices are

 single chars:

   "."    standard.xmlspec.html.xsl
   "-"    standard-xmlspec-html.xsl
   "_"    standard_xmlspec_html.xsl 
   "@"    standard@xmlspec@html.xsl
   ...

 more complex char names

  "[]"   standard.[xmlspec][html].xsl
  "{-}"  standard.{xmlspec-html}.xsl
  ...

What are your comments? (please, let's not get too religious
about this, let's come up with real arguments, not personal
esthetic reasons only) Keep in mind that this is not
mandating in any way. I was trying to get your comments out
of good practices to allow easier information interchange.

An obvious design principle is that the chosen delimiter
should not need to be escaped when entered on the command
line of common shells (including, eek, COMMAND.COM)

Off the top of my head (I'm really not sure about it)
this leaves only "-" and "_".