# The RIS XML DTD - a XML application based on the RIS reference format

# (C) 2003-03-22 Markus Hoenicka <markus@mhoenicka.de>

# Invoke with the following declaration

# <!DOCTYPE ris PUBLIC "-//Markus Hoenicka//DTD Ris V1.3.0//EN" "http://refdb.sourceforge.net/dtd/risx-1.3.0/risx.dtd">

# the top-level element

namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"

ris = element ris { attlist.ris, entry+ }
attlist.ris &= empty
# each RIS dataset is encoded by the following structure:

# part, publication, and set denote the analytical, monographic, and

# serial level of bibliographic information.

# libinfo contains all information relevant for local housekeeping

# contents describes the contents of the reference described by the

# dataset

# the type attribute is equivalent to the TY RIS field

# the identifier attributes: ID is a numeric one, while citekey is an

# alphanumeric key. Both are supposed to be unique in a database

# note to self: why was there a "+"?

# <!ELEMENT entry (part?,publication,set?,libinfo*,contents?)+>
entry =
  element entry {
    attlist.entry, part?, publication, set?, libinfo*, contents?
  }
attlist.entry &=
  [ a:defaultValue = "GEN" ]
  attribute type {
    "ABST"
    | "ADVS"
    | "ART"
    | "BILL"
    | "BOOK"
    | "CASE"
    | "CHAP"
    | "COMP"
    | "CONF"
    | "CTLG"
    | "DATA"
    | "ELEC"
    | "GEN"
    | "HEAR"
    | "ICOMM"
    | "INPR"
    | "JFULL"
    | "JOUR"
    | "MAP"
    | "MGZN"
    | "MPCT"
    | "MUSIC"
    | "NEWS"
    | "PAMP"
    | "PAT"
    | "PCOMM"
    | "RPRT"
    | "SER"
    | "SLIDE"
    | "SOUND"
    | "STAT"
    | "THES"
    | "UNBILL"
    | "UNPB"
    | "VIDEO"
  }?,
  attribute id { xsd:NMTOKEN }?,
  attribute citekey { xsd:NMTOKEN }?
# the three levels of bibliographic information
part = element part { attlist.part, title, author* }
attlist.part &= empty
publication =
  element publication { attlist.publication, title*, author*, pubinfo? }
attlist.publication &= empty
set = element set { attlist.set, title*, author* }
attlist.set &= empty
# the apparatus used in the bibliographic information
title = element title { attlist.title, text }
attlist.title &=
  [ a:defaultValue = "full" ]
  attribute type { "full" | "abbrev" | "user1" | "user2" }?,
  attribute freq { xsd:NMTOKEN }?,
  attribute relfreq { xsd:NMTOKEN }?
# The url element is gone in favour of 'link type="url"'. Both elements use the same semantics so it would be weird to keep them separately
pubinfo =
  element pubinfo {
    attlist.pubinfo,
    pubdate*,
    volume?,
    issue?,
    conftitle?,
    startpage?,
    endpage?,
    city?,
    publisher?,
    serial?,
    address?,
    userdef*,
    misc*,
    link*
  }
attlist.pubinfo &= empty
pubdate = element pubdate { attlist.pubdate, date, otherinfo? }
attlist.pubdate &=
  [ a:defaultValue = "primary" ]
  attribute type { "primary" | "secondary" }?
date = element date { attlist.date, year?, month?, day? }
attlist.date &= empty
year = element year { attlist.year, text }
attlist.year &= empty
month = element month { attlist.month, text }
attlist.month &= empty
day = element day { attlist.day, text }
attlist.day &= empty
otherinfo = element otherinfo { attlist.otherinfo, text }
attlist.otherinfo &= empty
volume = element volume { attlist.volume, text }
attlist.volume &= empty
issue = element issue { attlist.issue, text }
attlist.issue &= empty
conftitle = element conftitle { attlist.conftitle, text }
attlist.conftitle &= empty
startpage = element startpage { attlist.startpage, text }
attlist.startpage &= empty
endpage = element endpage { attlist.endpage, text }
attlist.endpage &= empty
city = element city { attlist.city, text }
attlist.city &= empty
publisher = element publisher { attlist.publisher, text }
attlist.publisher &= empty
serial = element serial { attlist.serial, text }
attlist.serial &= empty
address = element address { attlist.address, text }
attlist.address &= empty
userdef = element userdef { attlist.userdef, text }
attlist.userdef &=
  [ a:defaultValue = "1" ]
  attribute type { "1" | "2" | "3" | "4" | "5" }?
misc = element misc { attlist.misc, text }
attlist.misc &=
  [ a:defaultValue = "1" ] attribute type { "1" | "2" | "3" }?
link = element link { attlist.link, text }
attlist.link &=
  [ a:defaultValue = "url" ]
  attribute type {
    "url" | "pdf" | "fulltext" | "related" | "image" | "doi"
  }?
# the libinfo element contains the local housekeeping information

# specific to a single user
libinfo =
  element libinfo {
    attlist.libinfo, notes?, reprint, availability?, link*
  }
attlist.libinfo &= attribute user { xsd:NMTOKEN }
notes = element notes { attlist.notes, text }
attlist.notes &= empty
reprint = element reprint { attlist.reprint, date? }
attlist.reprint &=
  [ a:defaultValue = "NOTINFILE" ]
  attribute status { "NOTINFILE" | "ONREQUEST" | "INFILE" }?
availability = element availability { attlist.availability, text }
attlist.availability &=
  [ a:defaultValue = "full" ] attribute type { "full" | "useroot" }?
# the contents element contains information about the contents of

# the reference
contents = element contents { attlist.contents, abstract?, keyword* }
attlist.contents &= empty
abstract = element abstract { attlist.abstract, text }
attlist.abstract &= empty
keyword = element keyword { attlist.keyword, text }
attlist.keyword &=
  attribute freq { xsd:NMTOKEN }?,
  attribute relfreq { xsd:NMTOKEN }?
# the author element
author =
  element author {
    attlist.author,
    (name | (lastname?, firstname?, middlename*, suffix?))
  }
attlist.author &=
  attribute role { xsd:NMTOKEN }?,
  attribute freq { xsd:NMTOKEN }?,
  attribute relfreq { xsd:NMTOKEN }?
name = element name { attlist.name, text }
attlist.name &= empty
lastname = element lastname { attlist.lastname, text }
attlist.lastname &= empty
firstname = element firstname { attlist.firstname, text }
attlist.firstname &= empty
middlename = element middlename { attlist.middlename, text }
attlist.middlename &= empty
suffix = element suffix { attlist.suffix, text }
attlist.suffix &= empty
start = ris
