default namespace = "http://dblatex.sourceforge.net/config"

start = config
config =
  element config {
    attribute version { text }?, (latex | xslt | imagedata | options)*
  }

# <latex> element and children syntaxes 
#
latex =
  element latex {
    empty,
    (texinputs
     | bibinputs
     | bstinputs
     | backend
     | texstyle
     | texpost
     | indexstyle)*
  }

attlist.modname = attribute use { text }
attlist.filepath = attribute fileref { text }
attlist.mod_or_file =
  attlist.modname |
  attlist.filepath

backend = element backend { attlist.modname, empty }
texstyle = element texstyle { attlist.mod_or_file, empty }
texpost = element texpost { attlist.mod_or_file, empty }
indexstyle = element indexstyle { attlist.filepath, empty }
texinputs = element texinputs { text }
bibinputs = element bibinputs { text }
bstinputs = element bstinputs { text }

# <xslt> element and children syntaxes 
#
xslt = element xslt { (stylesheet | engine)* }

stylesheet = element stylesheet { attlist.filepath, empty }
engine =
  element engine { attlist.engine, (commandchain | command)? }
attlist.engine =
  attlist.modname |
  attribute param-format { text }

# <imagedata> element and children syntaxes 
#
imagedata =
  element imagedata { (figpath | figformat | formatrule | converter)* }

figpath = element figpath { attlist.filepath, empty }
figformat = element figformat { text }
formatrule = element formatrule { attlist.formatrule, empty }
attlist.formatrule =
  attribute dst { text }?,
  attribute docformat { "dvi" | "ps" | "pdf" | "*" }?,
  attribute backend { text }?

converter =
  element converter { attlist.converter, (commandchain | command) }
attlist.converter =
  attribute src { text }?,
  attribute dst { text }?,
  attribute docformat { "dvi" | "ps" | "pdf" | "*" }?,
  attribute backend { text }?

# General <command> syntax
#
commandchain = element commandchain { command+ }
command = element command { attlist.command, text }
attlist.command =
  attribute input { text }?,
  attribute output { text }?,
  attribute shell { "0" | "1" | "false" | "true" }?

# <options> syntax
#
options = element options { text }

