Protégé-OWL 3.4.8

edu.stanford.smi.protegex.owl.writer.xml
Interface XMLWriter

All Known Implementing Classes:
DefaultXMLWriter

public interface XMLWriter

User: matthewhorridge
The Univeristy Of Manchester
Medical Informatics Group
Date: Mar 22, 2005

matthew.horridge@cs.man.ac.uk
www.cs.man.ac.uk/~horridgm


Method Summary
 void endDocument()
          Causes all open elements, including the document root element, to be closed.
 String getDefaultNamespace()
          Gets the default namespace that the rdfwriter uses.
 XMLWriterNamespaceManager getNamespacePrefixes()
          Gets the rdfwriter's namespace manager.
 String getXMLBase()
           
 void setEncoding(String encoding)
          Sets the encoding for the document that the rdfwriter produces.
 void setWrapAttributes(boolean b)
          Causes the current element's attributes to be wrapped in the output.
 void startDocument(String rootElementName)
          Starts writing the document.
 void writeAttribute(String attr, String val)
          Writes an attribute of the last element to be started (that has not been closed).
 void writeEndElement()
          Writes the closing tag of the last element to be started.
 void writeStartElement(String name)
          Writes the start of an element
 void writeStartElement(String namespace, String name)
          Writes the start of an element with namespace and a name
 void writeTextContent(String text)
          Writes a text element
 

Method Detail

setEncoding

void setEncoding(String encoding)
Sets the encoding for the document that the rdfwriter produces. The default encoding is "UTF-8".

Parameters:
encoding - The encoding.

getDefaultNamespace

String getDefaultNamespace()
Gets the default namespace that the rdfwriter uses.


getNamespacePrefixes

XMLWriterNamespaceManager getNamespacePrefixes()
Gets the rdfwriter's namespace manager.


getXMLBase

String getXMLBase()

setWrapAttributes

void setWrapAttributes(boolean b)
Causes the current element's attributes to be wrapped in the output.


startDocument

void startDocument(String rootElementName)
                   throws IOException
Starts writing the document. The root element will contain the namespace declarations and xml:base attribute.

Parameters:
rootElementName - The name of the root element.
Throws:
IOException

endDocument

void endDocument()
                 throws IOException
Causes all open elements, including the document root element, to be closed.

Throws:
IOException

writeStartElement

void writeStartElement(String name)
                       throws IOException
Writes the start of an element

Parameters:
name - The tag name of the element to be written.
Throws:
IOException

writeStartElement

void writeStartElement(String namespace,
                       String name)
                       throws IOException
Writes the start of an element with namespace and a name

Parameters:
namespace - The namespace of the element to be written (e.g. http://smi-protege.stanford.edu/ontologes/test.owl#)
Throws:
IOException

writeEndElement

void writeEndElement()
                     throws IOException
Writes the closing tag of the last element to be started.

Throws:
IOException

writeAttribute

void writeAttribute(String attr,
                    String val)
                    throws IOException
Writes an attribute of the last element to be started (that has not been closed).

Parameters:
attr - The name of the attribute
val - The value of the attribute
Throws:
IOException

writeTextContent

void writeTextContent(String text)
                      throws IOException
Writes a text element

Parameters:
text - The text to be written
Throws:
IOException

Protégé-OWL 3.4.8

Submit a bug report or feature request
Copyright (c) 1998-2012 Stanford University.