Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15
OOoRunner test harness

util
Class XMLTools.XMLWellFormChecker

util.XMLTools.XMLWriter
  |
  +--util.XMLTools.XMLWellFormChecker
Direct Known Subclasses:
XMLTools.XMLChecker, XMLTools.XMLTagsChecker
Enclosing class:
XMLTools

public static class XMLTools.XMLWellFormChecker
extends XMLTools.XMLWriter

Checks if the XML structure is well formed (i.e. all tags opened must be closed and all tags opened inside a tag must be closed inside the same tag). It also checks parameters passed. If any collisions found appropriate error message is output into a stream specified. No XML data output, i.e. no output will be performed if no errors occur.

After document is completed there is a way to cehck if the XML data and structure was valid.


Field Summary
protected  boolean docEnded
           
protected  boolean docStarted
           
protected  PrintWriter log
           
protected  boolean noOtherErrors
           
protected  boolean printXMLData
           
protected  Vector tagStack
           
protected  boolean wellFormed
           
 
Constructor Summary
XMLTools.XMLWellFormChecker(PrintWriter log)
           
XMLTools.XMLWellFormChecker(PrintWriter log_, boolean printXMLData)
           
 
Method Summary
 void endDocument()
           
 void endElement(String name)
           
 boolean isWellFormed()
          Checks if there were no errors during document handling.
 void printError(String msg)
          Prints error message and all tags where error occured inside.
 void reset()
          Reset all values.
 void startDocument()
           
 void startElement(String name, com.sun.star.xml.sax.XAttributeList attr)
           
 
Methods inherited from class util.XMLTools.XMLWriter
characters, ignorableWhitespace, processingInstruction, setDocumentLocator
 

Field Detail

docStarted

protected boolean docStarted

docEnded

protected boolean docEnded

tagStack

protected Vector tagStack

wellFormed

protected boolean wellFormed

noOtherErrors

protected boolean noOtherErrors

log

protected PrintWriter log

printXMLData

protected boolean printXMLData
Constructor Detail

XMLTools.XMLWellFormChecker

public XMLTools.XMLWellFormChecker(PrintWriter log)

XMLTools.XMLWellFormChecker

public XMLTools.XMLWellFormChecker(PrintWriter log_,
                                   boolean printXMLData)
Method Detail

reset

public void reset()
Reset all values. This is important e.g. for test of XFilter interface, where 'filter()' method istbstarted twice.

startDocument

public void startDocument()
Overrides:
startDocument in class XMLTools.XMLWriter

endDocument

public void endDocument()
Overrides:
endDocument in class XMLTools.XMLWriter

startElement

public void startElement(String name,
                         com.sun.star.xml.sax.XAttributeList attr)
Overrides:
startElement in class XMLTools.XMLWriter

endElement

public void endElement(String name)
Overrides:
endElement in class XMLTools.XMLWriter

isWellFormed

public boolean isWellFormed()
Checks if there were no errors during document handling. I.e. startDocument() and endDocument() must be called, XML must be well formed, paramters must be valid.

printError

public void printError(String msg)
Prints error message and all tags where error occured inside. Also prints "Tag trace" in case if the full XML data isn't printed.

OOoRunner test harness

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.