nz.ac.waikato.bibliography.XMLParser
Class ParseBibliographyXML

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by nz.ac.waikato.mcennis.rat.parser.xmlHandler.Handler
          extended by nz.ac.waikato.bibliography.XMLParser.ParseBibliographyXML
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class ParseBibliographyXML
extends Handler

XML SAX parser for parsing a custom bibliography XML format with most of the information inside a bibtex file containing journal entries.
The DTD of the XML file is as follows:


 <!DOCTYPE bibliography [

       <!ELEMENT bibliography (authorRef+,paper+)>

      <!ELEMENT authorRef (authorName,authorID)>

       <!ELEMENT authorName (#PCDATA)>

       <!ELEMENT authorID (#PCDATA)>

       <!ELEMENT paper (paperID,title,abstract,authorList,year,file,type,journal,referenceList,citationList,clusterId?)>

       <!ELEMENT paperID (#PCDATA)>

       <!ELEMENT title (#PCDATA)>

       <!ELEMENT abstract (#PCDATA)>

       <!ELEMENT authorList (author+)>

       <!ELEMENT author (#PCDATA)>

       <!ELEMENT year (#PCDATA)>

       <!ELEMENT file (#PCDATA)>

       <!ELEMENT type (#PCDATA)>

       <!ELEMENT journal (#PCDATA)>

       <!ELEMENT referenceList (reference*)>

       <!ELEMENT reference (#PCDATA)>

       <!ELEMENT citationList (citation*)>

       <!ELEMENT citation (#PCDATA)>

       <!ELEMENT clusterId (#PCDATA)>

]>


Field Summary
 
Fields inherited from class nz.ac.waikato.mcennis.rat.parser.xmlHandler.Handler
properties, site
 
Constructor Summary
ParseBibliographyXML()
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 Handler duplicate()
          Create a complete duplicate of this class
 void endDocument()
           
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
           
 ParsedObject get()
          Return the underlying parsed object
 java.lang.String getAuthorMode()
          Return the mode used for authors of papers.
 java.lang.String getPaperMode()
          Return the mode used for papers.
 java.lang.String getReferencesRelation()
          return the relation for citation links
 java.lang.String getWroteRelation()
          Return the relation for authorship links
 boolean isAddClusters()
          Are subgraphs created from cluster designations in the XML file
 boolean isBiDirectionalReferences()
          are created citations bidirectional
 void set(ParsedObject o)
          Set the underlying parsed object for parsing
 void setAddClusters(boolean addClusters)
          Sets whether subgraphs are created or not from cluster data in the bibligoraphic entry
 void setAuthorMode(java.lang.String authorMode)
          Set the mode used for authors of papers.
 void setBiDirectionalReferences(boolean biDirectionalReferences)
          Set whether citations are bidirectional
 void setPaperMode(java.lang.String paperMode)
          Set the mode used for papers.
 void setReferencesRelation(java.lang.String referencesRelation)
          Set the relation for citation links
 void setWroteRelation(java.lang.String wroteRelation)
          Set the relation for authorship links
 void startDocument()
           
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
           
 
Methods inherited from class nz.ac.waikato.mcennis.rat.parser.xmlHandler.Handler
check, check, error, fatalError, getName, getParameter, getParameter, init, setCrawler, setName, setProperties, warning
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParseBibliographyXML

public ParseBibliographyXML()
Method Detail

isBiDirectionalReferences

public boolean isBiDirectionalReferences()
are created citations bidirectional

Returns:
are citations bidirectional

setBiDirectionalReferences

public void setBiDirectionalReferences(boolean biDirectionalReferences)
Set whether citations are bidirectional

Parameters:
biDirectionalReferences - are citations bidirectional

getAuthorMode

public java.lang.String getAuthorMode()
Return the mode used for authors of papers.

Returns:
mode for authors

getPaperMode

public java.lang.String getPaperMode()
Return the mode used for papers.

Returns:
mode of papers

getWroteRelation

public java.lang.String getWroteRelation()
Return the relation for authorship links

Returns:
relation for authorship

getReferencesRelation

public java.lang.String getReferencesRelation()
return the relation for citation links

Returns:
relation for citation links

setAuthorMode

public void setAuthorMode(java.lang.String authorMode)
Set the mode used for authors of papers.

Parameters:
authorMode - mode for authors

setPaperMode

public void setPaperMode(java.lang.String paperMode)
Set the mode used for papers.

Parameters:
paperMode - mode for papers.

setWroteRelation

public void setWroteRelation(java.lang.String wroteRelation)
Set the relation for authorship links

Parameters:
wroteRelation - relation for authorship

setReferencesRelation

public void setReferencesRelation(java.lang.String referencesRelation)
Set the relation for citation links

Parameters:
referencesRelation - relation for citation links

isAddClusters

public boolean isAddClusters()
Are subgraphs created from cluster designations in the XML file

Returns:
are subgraphs created

setAddClusters

public void setAddClusters(boolean addClusters)
Sets whether subgraphs are created or not from cluster data in the bibligoraphic entry

Parameters:
addClusters - are subgraphs created

get

public ParsedObject get()
Description copied from class: Handler
Return the underlying parsed object

Specified by:
get in class Handler
Returns:
parsed object

set

public void set(ParsedObject o)
Description copied from class: Handler
Set the underlying parsed object for parsing

Specified by:
set in class Handler
Parameters:
o - underlying parsed object

duplicate

public Handler duplicate()
Description copied from class: Handler
Create a complete duplicate of this class

Specified by:
duplicate in class Handler
Returns:
deep copy of the original.

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

Get Relational Analysis Toolkit at SourceForge.net. Fast, secure and Free Open Source software downloads