org.jopendocument.dom
Class NS

java.lang.Object
  extended by org.jopendocument.dom.NS

public final class NS
extends java.lang.Object

Encapsulate all namespaces for a particular version of xml.

Author:
ILM Informatique 26 juil. 2004

Method Summary
static NS get(java.lang.String name)
           
 org.jdom.Namespace[] getALL()
           
 org.jdom.Namespace getManifest()
           
 org.jdom.Namespace getMETA()
           
 org.jdom.Namespace getNS(java.lang.String prefix)
           
static NS getOD()
          Namespaces for OpenDocument/OpenOffice.org 2.x.
 org.jdom.Namespace getOFFICE()
           
static NS getOOo()
          Namespaces for OpenOffice.org 1.x.
static NS getParent(org.jdom.Namespace ns)
          Find the NS to which belongs the passed namespace.
 org.jdom.Namespace getSTYLE()
           
 org.jdom.Namespace getTABLE()
           
 org.jdom.Namespace getTEXT()
           
 java.lang.String getVersion()
           
static java.lang.String getVersion(org.jdom.Document doc)
           
static java.lang.String getVersion(org.jdom.Element elem)
          Infer the version of an OO xml element from its namespace.
 void put(java.lang.String prefix, java.lang.String uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

put

public void put(java.lang.String prefix,
                java.lang.String uri)

getNS

public final org.jdom.Namespace getNS(java.lang.String prefix)

getVersion

public final java.lang.String getVersion()

getManifest

public final org.jdom.Namespace getManifest()

getOFFICE

public org.jdom.Namespace getOFFICE()

getSTYLE

public org.jdom.Namespace getSTYLE()

getTEXT

public org.jdom.Namespace getTEXT()

getTABLE

public org.jdom.Namespace getTABLE()

getMETA

public org.jdom.Namespace getMETA()

getALL

public org.jdom.Namespace[] getALL()

get

public static final NS get(java.lang.String name)

getOOo

public static final NS getOOo()
Namespaces for OpenOffice.org 1.x.

Returns:
namespaces for OO.o 1.

getOD

public static final NS getOD()
Namespaces for OpenDocument/OpenOffice.org 2.x.

Returns:
namespaces for OpenDocument.

getParent

public static final NS getParent(org.jdom.Namespace ns)
Find the NS to which belongs the passed namespace.

Parameters:
ns - the namespace, eg office=http://openoffice.org/2000/office.
Returns:
the matching NS, eg NS.getOOo(), or null if none is found.

getVersion

public static final java.lang.String getVersion(org.jdom.Document doc)

getVersion

public static final java.lang.String getVersion(org.jdom.Element elem)
Infer the version of an OO xml element from its namespace.

Parameters:
elem - the element to be tested, eg <text:line-break/>.
Returns:
the name of the version.
Throws:
java.lang.IllegalArgumentException - if the namespace is unknown.
See Also:
OOUtils.VERSION_1, OOUtils.VERSION_2