Language

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

util
Class XMLTools.XMLTagsChecker

util.XMLTools.XMLWriter
  |
  +--util.XMLTools.XMLWellFormChecker
        |
        +--util.XMLTools.XMLTagsChecker
Enclosing class:
XMLTools

public static class XMLTools.XMLTagsChecker
extends XMLTools.XMLWellFormChecker

Beside structure of XML this class also can check existence of tags, inner tags, and character data. After document completion there is a way to check if required tags and character data was found. If there any error occurs an appropriate message is output.


Field Summary
protected  boolean allOK
           
protected  Hashtable chars
           
protected  Hashtable tags
           
 
Fields inherited from class util.XMLTools.XMLWellFormChecker
docEnded, docStarted, log, noOtherErrors, printXMLData, tagStack, wellFormed
 
Constructor Summary
XMLTools.XMLTagsChecker(PrintWriter log)
           
 
Method Summary
 void addCharacters(String ch)
          Adds a character data which must be contained in the XML data.
 void addCharactersEnclosed(String ch, String outerTag)
          Adds a character data which must be contained in the XML data and must be inside the tag with name outerTag.
 void addTag(String tag)
          Adds a tag name which must be contained in the XML data.
 void addTagEnclosed(String tag, String outerTag)
          Adds a tag name which must be contained in the XML data and must be inside the tag with name outerTag.
 void characters(String ch)
           
 boolean checkTags()
          Checks if the XML data was valid and well formed and if all necessary tags and character data was found.
 void startElement(String name, com.sun.star.xml.sax.XAttributeList attrs)
           
 
Methods inherited from class util.XMLTools.XMLWellFormChecker
endDocument, endElement, isWellFormed, printError, reset, startDocument
 
Methods inherited from class util.XMLTools.XMLWriter
ignorableWhitespace, processingInstruction, setDocumentLocator
 

Field Detail

tags

protected Hashtable tags

chars

protected Hashtable chars

allOK

protected boolean allOK
Constructor Detail

XMLTools.XMLTagsChecker

public XMLTools.XMLTagsChecker(PrintWriter log)
Method Detail

addTag

public void addTag(String tag)
Adds a tag name which must be contained in the XML data.

addTagEnclosed

public void addTagEnclosed(String tag,
                           String outerTag)
Adds a tag name which must be contained in the XML data and must be inside the tag with name outerTag.

addCharacters

public void addCharacters(String ch)
Adds a character data which must be contained in the XML data.

addCharactersEnclosed

public void addCharactersEnclosed(String ch,
                                  String outerTag)
Adds a character data which must be contained in the XML data and must be inside the tag with name outerTag.

startElement

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

characters

public void characters(String ch)
Overrides:
characters in class XMLTools.XMLWriter

checkTags

public boolean checkTags()
Checks if the XML data was valid and well formed and if all necessary tags and character data was found.

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.