<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:exsl="http://exslt.org/common"
                version="1.0">

<xsl:variable name="docbook-element-list">
  <simplelist>
    <member>abbrev</member>
    <member>abstract</member>
    <member>accel</member>
    <member>ackno</member>
    <member>acronym</member>
    <member>action</member>
    <member>address</member>
    <member>affiliation</member>
    <member>alt</member>
    <member>anchor</member>
    <member>answer</member>
    <member>appendix</member>
    <member>appendixinfo</member>
    <member>application</member>
    <member>area</member>
    <member>areaset</member>
    <member>areaspec</member>
    <member>arg</member>
    <member>article</member>
    <member>articleinfo</member>
    <member>artpagenums</member>
    <member>attribution</member>
    <member>audiodata</member>
    <member>audioobject</member>
    <member>author</member>
    <member>authorblurb</member>
    <member>authorgroup</member>
    <member>authorinitials</member>
    <member>beginpage</member>
    <member>bibliocoverage</member>
    <member>bibliodiv</member>
    <member>biblioentry</member>
    <member>bibliography</member>
    <member>bibliographyinfo</member>
    <member>biblioid</member>
    <member>bibliomisc</member>
    <member>bibliomixed</member>
    <member>bibliomset</member>
    <member>bibliorelation</member>
    <member>biblioset</member>
    <member>bibliosource</member>
    <member>blockinfo</member>
    <member>blockquote</member>
    <member>book</member>
    <member>bookinfo</member>
    <member>bridgehead</member>
    <member>callout</member>
    <member>calloutlist</member>
    <member>caption</member>
    <member>caution</member>
    <member>chapter</member>
    <member>chapterinfo</member>
    <member>citation</member>
    <member>citebiblioid</member>
    <member>citerefentry</member>
    <member>citetitle</member>
    <member>city</member>
    <member>classname</member>
    <member>classsynopsis</member>
    <member>classsynopsisinfo</member>
    <member>cmdsynopsis</member>
    <member>co</member>
    <member>collab</member>
    <member>collabname</member>
    <member>colophon</member>
    <member>colspec</member>
    <member>command</member>
    <member>computeroutput</member>
    <member>confdates</member>
    <member>confgroup</member>
    <member>confnum</member>
    <member>confsponsor</member>
    <member>conftitle</member>
    <member>constant</member>
    <member>constraint</member>
    <member>constraintdef</member>
    <member>constructorsynopsis</member>
    <member>contractnum</member>
    <member>contractsponsor</member>
    <member>contrib</member>
    <member>copyright</member>
    <member>coref</member>
    <member>corpauthor</member>
    <member>corpname</member>
    <member>country</member>
    <member>database</member>
    <member>date</member>
    <member>dedication</member>
    <member>destructorsynopsis</member>
    <member>edition</member>
    <member>editor</member>
    <member>email</member>
    <member>emphasis</member>
    <member>entry</member>
    <member>entrytbl</member>
    <member>envar</member>
    <member>epigraph</member>
    <member>equation</member>
    <member>errorcode</member>
    <member>errorname</member>
    <member>errortext</member>
    <member>errortype</member>
    <member>example</member>
    <member>exceptionname</member>
    <member>fax</member>
    <member>fieldsynopsis</member>
    <member>figure</member>
    <member>filename</member>
    <member>firstname</member>
    <member>firstterm</member>
    <member>footnote</member>
    <member>footnoteref</member>
    <member>foreignphrase</member>
    <member>formalpara</member>
    <member>funcdef</member>
    <member>funcparams</member>
    <member>funcprototype</member>
    <member>funcsynopsis</member>
    <member>funcsynopsisinfo</member>
    <member>function</member>
    <member>glossary</member>
    <member>glossaryinfo</member>
    <member>glossdef</member>
    <member>glossdiv</member>
    <member>glossentry</member>
    <member>glosslist</member>
    <member>glosssee</member>
    <member>glossseealso</member>
    <member>glossterm</member>
    <member>graphic</member>
    <member>graphicco</member>
    <member>group</member>
    <member>guibutton</member>
    <member>guiicon</member>
    <member>guilabel</member>
    <member>guimenu</member>
    <member>guimenuitem</member>
    <member>guisubmenu</member>
    <member>hardware</member>
    <member>highlights</member>
    <member>holder</member>
    <member>honorific</member>
    <member>imagedata</member>
    <member>imageobject</member>
    <member>imageobjectco</member>
    <member>important</member>
    <member>index</member>
    <member>indexdiv</member>
    <member>indexentry</member>
    <member>indexinfo</member>
    <member>indexterm</member>
    <member>informalequation</member>
    <member>informalexample</member>
    <member>informalfigure</member>
    <member>informaltable</member>
    <member>initializer</member>
    <member>inlineequation</member>
    <member>inlinegraphic</member>
    <member>inlinemediaobject</member>
    <member>interface</member>
    <member>interfacename</member>
    <member>invpartnumber</member>
    <member>isbn</member>
    <member>issn</member>
    <member>issuenum</member>
    <member>itemizedlist</member>
    <member>itermset</member>
    <member>jobtitle</member>
    <member>keycap</member>
    <member>keycode</member>
    <member>keycombo</member>
    <member>keysym</member>
    <member>keyword</member>
    <member>keywordset</member>
    <member>label</member>
    <member>legalnotice</member>
    <member>lhs</member>
    <member>lineage</member>
    <member>lineannotation</member>
    <member>link</member>
    <member>listitem</member>
    <member>literal</member>
    <member>literallayout</member>
    <member>lot</member>
    <member>lotentry</member>
    <member>manvolnum</member>
    <member>markup</member>
    <member>medialabel</member>
    <member>mediaobject</member>
    <member>mediaobjectco</member>
    <member>member</member>
    <member>menuchoice</member>
    <member>methodname</member>
    <member>methodparam</member>
    <member>methodsynopsis</member>
    <member>modespec</member>
    <member>modifier</member>
    <member>mousebutton</member>
    <member>msg</member>
    <member>msgaud</member>
    <member>msgentry</member>
    <member>msgexplan</member>
    <member>msginfo</member>
    <member>msglevel</member>
    <member>msgmain</member>
    <member>msgorig</member>
    <member>msgrel</member>
    <member>msgset</member>
    <member>msgsub</member>
    <member>msgtext</member>
    <member>nonterminal</member>
    <member>note</member>
    <member>objectinfo</member>
    <member>olink</member>
    <member>ooclass</member>
    <member>ooexception</member>
    <member>oointerface</member>
    <member>option</member>
    <member>optional</member>
    <member>orderedlist</member>
    <member>orgdiv</member>
    <member>orgname</member>
    <member>otheraddr</member>
    <member>othercredit</member>
    <member>othername</member>
    <member>pagenums</member>
    <member>para</member>
    <member>paramdef</member>
    <member>parameter</member>
    <member>part</member>
    <member>partinfo</member>
    <member>partintro</member>
    <member>personblurb</member>
    <member>personname</member>
    <member>phone</member>
    <member>phrase</member>
    <member>pob</member>
    <member>postcode</member>
    <member>preface</member>
    <member>prefaceinfo</member>
    <member>primary</member>
    <member>primaryie</member>
    <member>printhistory</member>
    <member>procedure</member>
    <member>production</member>
    <member>productionrecap</member>
    <member>productionset</member>
    <member>productname</member>
    <member>productnumber</member>
    <member>programlisting</member>
    <member>programlistingco</member>
    <member>prompt</member>
    <member>property</member>
    <member>pubdate</member>
    <member>publisher</member>
    <member>publishername</member>
    <member>pubsnumber</member>
    <member>qandadiv</member>
    <member>qandaentry</member>
    <member>qandaset</member>
    <member>question</member>
    <member>quote</member>
    <member>refclass</member>
    <member>refdescriptor</member>
    <member>refentry</member>
    <member>refentryinfo</member>
    <member>refentrytitle</member>
    <member>reference</member>
    <member>referenceinfo</member>
    <member>refmeta</member>
    <member>refmiscinfo</member>
    <member>refname</member>
    <member>refnamediv</member>
    <member>refpurpose</member>
    <member>refsect1</member>
    <member>refsect1info</member>
    <member>refsect2</member>
    <member>refsect2info</member>
    <member>refsect3</member>
    <member>refsect3info</member>
    <member>refsection</member>
    <member>refsectioninfo</member>
    <member>refsynopsisdiv</member>
    <member>refsynopsisdivinfo</member>
    <member>releaseinfo</member>
    <member>remark</member>
    <member>replaceable</member>
    <member>returnvalue</member>
    <member>revdescription</member>
    <member>revhistory</member>
    <member>revision</member>
    <member>revnumber</member>
    <member>revremark</member>
    <member>rhs</member>
    <member>row</member>
    <member>sbr</member>
    <member>screen</member>
    <member>screenco</member>
    <member>screeninfo</member>
    <member>screenshot</member>
    <member>secondary</member>
    <member>secondaryie</member>
    <member>sect1</member>
    <member>sect1info</member>
    <member>sect2</member>
    <member>sect2info</member>
    <member>sect3</member>
    <member>sect3info</member>
    <member>sect4</member>
    <member>sect4info</member>
    <member>sect5</member>
    <member>sect5info</member>
    <member>section</member>
    <member>sectioninfo</member>
    <member>see</member>
    <member>seealso</member>
    <member>seealsoie</member>
    <member>seeie</member>
    <member>seg</member>
    <member>seglistitem</member>
    <member>segmentedlist</member>
    <member>segtitle</member>
    <member>seriesvolnums</member>
    <member>set</member>
    <member>setindex</member>
    <member>setindexinfo</member>
    <member>setinfo</member>
    <member>sgmltag</member>
    <member>shortaffil</member>
    <member>shortcut</member>
    <member>sidebar</member>
    <member>sidebarinfo</member>
    <member>simpara</member>
    <member>simplelist</member>
    <member>simplemsgentry</member>
    <member>simplesect</member>
    <member>spanspec</member>
    <member>state</member>
    <member>step</member>
    <member>street</member>
    <member>structfield</member>
    <member>structname</member>
    <member>subject</member>
    <member>subjectset</member>
    <member>subjectterm</member>
    <member>subscript</member>
    <member>substeps</member>
    <member>subtitle</member>
    <member>superscript</member>
    <member>surname</member>
    <member>symbol</member>
    <member>synopfragment</member>
    <member>synopfragmentref</member>
    <member>synopsis</member>
    <member>systemitem</member>
    <member>table</member>
    <member>tbody</member>
    <member>term</member>
    <member>tertiary</member>
    <member>tertiaryie</member>
    <member>textdata</member>
    <member>textobject</member>
    <member>tfoot</member>
    <member>tgroup</member>
    <member>thead</member>
    <member>tip</member>
    <member>title</member>
    <member>titleabbrev</member>
    <member>toc</member>
    <member>tocback</member>
    <member>tocchap</member>
    <member>tocentry</member>
    <member>tocfront</member>
    <member>toclevel1</member>
    <member>toclevel2</member>
    <member>toclevel3</member>
    <member>toclevel4</member>
    <member>toclevel5</member>
    <member>tocpart</member>
    <member>token</member>
    <member>trademark</member>
    <member>type</member>
    <member>ulink</member>
    <member>userinput</member>
    <member>varargs</member>
    <member>variablelist</member>
    <member>varlistentry</member>
    <member>varname</member>
    <member>videodata</member>
    <member>videoobject</member>
    <member>void</member>
    <member>volumenum</member>
    <member>warning</member>
    <member>wordasword</member>
    <member>xref</member>
    <member>year</member>
  </simplelist>
</xsl:variable>

<xsl:variable name="docbook-elements"
              select="exsl:node-set($docbook-element-list)/simplelist"/>

<xsl:template name="is-docbook-element">
  <xsl:param name="element" select="''"/>

  <xsl:choose>
    <xsl:when test="$docbook-elements/member[. = $element]">1</xsl:when>
    <xsl:otherwise>0</xsl:otherwise>
  </xsl:choose>
</xsl:template>

</xsl:stylesheet>
