Project | WXT | Basics | Download | Documentation | Samples

Script: references-element

The purpose of a references element is to collect all (or many) references that you intend to use in your project in a file. It may simplify maintainance considerably, and it opens for a systematic reference policy. You may access the individual reference by PI Ref and you may produce reference lists by PI RefList . You may even control any URI's in a reference by PI ReferenceTest .

The definitions-element may contain any number of references elements.

<references location=""/>
location(mandatory) An URI which is absolute or relative to the script anchor.

The legal elements in a reference are (in any order):

  • title
  • authors
  • year
  • chaptertitle
  • journal
  • editor
  • place
  • publisher
  • pages
  • isbn
  • uri (with an optional attribute: dateread)
  • text
  • categories

Examples:

<references location="myrefs.xml"/>

A sample reference file:

_myrefs.xml
<?xml version="1.0" encoding="UTF-8"?>
<reflist version="1.0">   
         
    <ref id="As we may think">
        <uri dateread="14-03-20009">http://www.theatlantic.com/doc/194507/bush</uri>
        <year>1945</year>
        <title>As we may think</title>
        <publisher>the Atlantic</publisher>
        <authors>Bush,Vannevar</authors>
        <categories>tec</categories>
    </ref>
    
    <ref id="Mindstorms">
        <authors>Papert,Seymour</authors>
        <publisher>Harvester Press</publisher>
        <title>Mindstorms, Children Computers and Powerful Ideas</title> 
        <year>1980</year>
        <isbn>0-85527-163-9</isbn>
        <categories>ped</categories>
    </ref>
    
    <ref id="web2">
        <title>Web 2.0</title>
        <year>2005</year>
        <uri dateread="14-03-20009">http://en.wikipedia.org/wiki/Web_2.0</uri>
    </ref>    
</reflist>

Reference files are validated according to this schema:

_refs.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="reflist">
        <xs:complexType>
            <xs:choice maxOccurs="unbounded">
               <xs:element ref="ref" maxOccurs="unbounded"/>
            </xs:choice>
            <xs:attribute name="version" type="xs:decimal" use="required"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="ref">
        <xs:complexType>
            <xs:all>
                <xs:element ref="title" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="authors" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="year" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="chaptertitle" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="journal" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="editor" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="place" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="publisher" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="pages" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="isbn" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="uri" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="text" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="categories" minOccurs="0" maxOccurs="1"/>
             </xs:all>
            <xs:attribute name="id" type="xs:string" use="required"/>
        </xs:complexType>
    </xs:element>
    
    <!-- this is the definitions -->
    <xs:element name="title" type="xs:string"/>
    <xs:element name="authors" type="xs:string"/>
    <xs:element name="year" type="xs:short"/>
    <xs:element name="chaptertitle" type="xs:string"/>
    <xs:element name="journal" type="xs:string"/>
    <xs:element name="editor" type="xs:string"/>
    <xs:element name="place" type="xs:string"/>
    <xs:element name="publisher" type="xs:string"/>
    <xs:element name="pages" type="xs:string"/>
    <xs:element name="isbn" type="xs:string"/>
    <xs:element name="uri">
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:anyURI">
                    <xs:attribute name="dateread" type="xs:string" use="optional"/>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>
    <xs:element name="text" type="xs:string"/>
    <xs:element name="categories" type="xs:string"/>
</xs:schema>

See References for a full description.