org.jopendocument.dom
Class OOXML

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

public class OOXML
extends Object

Various bits of OpenDocument XML.

Author:
Sylvain CUAZ
See Also:
get(XMLVersion)

Method Summary
static String encodeOOWS(String s)
          Deprecated. see encodeWS(String)
protected  List encodeRT_L(String content, Map styles)
           
 org.jdom.Element encodeRT(String content, Map styles)
          Convert rich text (with [] tags) into XML.
 org.jdom.Element encodeWS(org.jdom.Element elem)
           
 org.jdom.Element encodeWS(String s)
          Encode a String to OO XML.
 void encodeWS(org.jdom.Text t)
           
static OOXML get(XMLVersion version)
          Returns the instance that match the requested version.
 org.jdom.Element getLineBreak()
           
static String getLineBreakS()
           
 org.jdom.Element getTab()
           
 String getTabS()
          Deprecated. use getTab()
 XMLVersion getVersion()
           
 String isValid(org.jdom.Document doc)
          Verify that the passed document is a valid OpenOffice.org 1 or ODF document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static OOXML get(XMLVersion version)
Returns the instance that match the requested version.

Parameters:
version - the version.
Returns:
the corresponding instance.

getLineBreakS

public static final String getLineBreakS()

encodeOOWS

public static final String encodeOOWS(String s)
Deprecated. see encodeWS(String)

Encode spaces for OpenOffice 1, and escape characters for XML.

Parameters:
s - a string to encode, eg "hi\n 3<4".
Returns:
the string encoded in XML, eg "hi3<4".

getVersion

public final XMLVersion getVersion()

isValid

public final String isValid(org.jdom.Document doc)
Verify that the passed document is a valid OpenOffice.org 1 or ODF document.

Parameters:
doc - the xml to test.
Returns:
null if doc is valid, a String describing the pb otherwise.

getLineBreak

public final org.jdom.Element getLineBreak()

getTab

public final org.jdom.Element getTab()

getTabS

public final String getTabS()
Deprecated. use getTab()

How to encode a tab.

Returns:
the xml string to encode a tab.

encodeRT_L

protected final List encodeRT_L(String content,
                                Map styles)

encodeRT

public final org.jdom.Element encodeRT(String content,
                                       Map styles)
Convert rich text (with [] tags) into XML.

Parameters:
content - the string to convert, eg "texte [b]gras[/b]".
styles - the mapping from tagname (eg "b") to the name of the character style (eg "Gras").
Returns:
the corresponding element.

encodeWS

public final org.jdom.Element encodeWS(String s)
Encode a String to OO XML. Handles substition of whitespaces to their OO equivalent.

Parameters:
s - a plain ole String, eg "term\tdefinition".
Returns:
an Element suitable to be inserted in an OO XML document, eg
     <text:span>term<text:tab-stop/>definition</text:span>
 
.

encodeWS

public final void encodeWS(org.jdom.Text t)

encodeWS

public final org.jdom.Element encodeWS(org.jdom.Element elem)


Copyright © 2010 jOpenDocument All Rights Reserved.