Interface XMLWriter

All Known Implementing Classes:
XMLWriterImpl

public interface XMLWriter
Developed as part of the CO-ODE project http://www.co-ode.org .
Since:
2.0.0
Author:
Matthew Horridge, The University Of Manchester, Medical Informatics Group
  • Method Details

    • setEncoding

      void setEncoding(String encoding)
      Sets the encoding for the document that the RDF writer produces. The default encoding is UTF-8.
      Parameters:
      encoding - The encoding.
    • getNamespacePrefixes

      XMLWriterNamespaceManager getNamespacePrefixes()
      Gets the Writer's namespace manager.
      Returns:
      The namespace manager.
    • getXMLBase

      String getXMLBase()
      Returns:
      the XML base
    • setWrapAttributes

      void setWrapAttributes(boolean b)
      Causes the current element's attributes to be wrapped in the output.
      Parameters:
      b - If true then the attributes will be wrapped if they are long. If false then no attribute wrapping will occur.
    • startDocument

      void startDocument(IRI rootElement)
      Starts writing the document. The root element will contain the namespace declarations and xml:base attribute.
      Parameters:
      rootElement - The iri of the root element.
    • endDocument

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

      void writeStartElement(IRI name)
      Writes the start of an element.
      Parameters:
      name - The tag name of the element to be written. This must be a valid QName. @throws IllegalElementNameException if the specified name is not a valid QName
    • writeEndElement

      void writeEndElement()
      Writes the closing tag of the last element to be started.
    • writeAttribute

      void writeAttribute(String attr, String val)
      Writes an attribute of the last element to be started (that has not been closed). Note: if the attribute is an iri, use writeAttribute(IRI, String
      Parameters:
      attr - The name of the attribute
      val - The value of the attribute
    • writeAttribute

      void writeAttribute(IRI attr, String val)
      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
    • writeTextContent

      void writeTextContent(String text)
      Writes a text element.
      Parameters:
      text - The text to be written
    • writeComment

      void writeComment(String commentText)
      Parameters:
      commentText - comment text