AHA
Class XmlFilter

java.lang.Object
  |
  +--AHA.XmlFilter

public class XmlFilter
extends java.lang.Object

XmlFilter is used for parsing XML documents, and it returns a HTML representation of the data


Field Summary
protected  AHA AHA
           
protected  java.lang.String DocName
           
protected  java.lang.String FullDocName
           
protected  java.util.Hashtable Knowledge
           
protected  java.io.PrintWriter out
           
protected  java.lang.String ShortDocName
           
 
Constructor Summary
XmlFilter(AHA AHA)
          This constructor is for base construction
XmlFilter(AHA AHA, java.lang.String FullDocName, java.lang.String DocName)
          This constructor may be used for outside calls
 
Method Summary
 java.lang.StringBuffer doHeaderFooter(org.w3c.dom.Node node)
          This method takes care of writing headers and footers, which consists of calling to the Messages object
 java.lang.String filterAnchorNode(org.w3c.dom.Node node)
          This returns a string containing an anchor
 boolean isAnchorStatement(org.w3c.dom.Node node)
          Is this node an anchor tag?
 boolean isBlockNode(org.w3c.dom.Node node)
          Is this node a block tag?
 boolean isFooterStatement(org.w3c.dom.Node node)
          Is this node a footer tag?
 boolean isHeaderStatement(org.w3c.dom.Node node)
          Is this node a header tag?
 boolean isHtmlCode(org.w3c.dom.Node node)
          Is this node a htmltag?
 boolean isIfStatement(org.w3c.dom.Node node)
          Is this node an if-tag?
 java.lang.StringBuffer makeIfChoice(org.w3c.dom.Node node)
          This method gets an if-tag and depending on the expression returns a block if if-expr=true --> first block (item(0)) if if-expr=false --> second block if any (item((1))
 void print(java.lang.Object s)
           
 java.lang.StringBuffer printAttr(org.w3c.dom.Node node1)
          Maybe this is only used for testing
 java.lang.StringBuffer printChildNodes(org.w3c.dom.Node nodec, boolean b)
          Get the (html) representation of the childs of this node
 void println(java.lang.Object s)
          Debug information
 java.lang.StringBuffer printNode(org.w3c.dom.Node node, boolean b)
          Get the (html) representation of this node
 void run()
          prints out the html to AHA.getWriter
 boolean teststr(org.w3c.dom.Node n)
          Node is an if-tag.
 boolean teststr(java.lang.String s)
          test an expression to the users knowledge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AHA

protected AHA AHA

out

protected java.io.PrintWriter out

Knowledge

protected java.util.Hashtable Knowledge

FullDocName

protected java.lang.String FullDocName

DocName

protected java.lang.String DocName

ShortDocName

protected java.lang.String ShortDocName
Constructor Detail

XmlFilter

public XmlFilter(AHA AHA)
This constructor is for base construction
Parameters:
AHA - the AHA context

XmlFilter

public XmlFilter(AHA AHA,
                 java.lang.String FullDocName,
                 java.lang.String DocName)
This constructor may be used for outside calls
Parameters:
AHA - pass the general AHA object
FullDocName - pass the exact url for the datadocument
DocName - the short name of the document
Method Detail

println

public void println(java.lang.Object s)
Debug information

print

public void print(java.lang.Object s)

teststr

public boolean teststr(java.lang.String s)
test an expression to the users knowledge
Parameters:
s - the expression to be checked

teststr

public boolean teststr(org.w3c.dom.Node n)
Node is an if-tag. The expression is given as an attribute "expr".
Parameters:
n - The if tag

isIfStatement

public boolean isIfStatement(org.w3c.dom.Node node)
Is this node an if-tag?

isHeaderStatement

public boolean isHeaderStatement(org.w3c.dom.Node node)
Is this node a header tag?

isFooterStatement

public boolean isFooterStatement(org.w3c.dom.Node node)
Is this node a footer tag?

isHtmlCode

public boolean isHtmlCode(org.w3c.dom.Node node)
Is this node a htmltag?

isAnchorStatement

public boolean isAnchorStatement(org.w3c.dom.Node node)
Is this node an anchor tag?

isBlockNode

public boolean isBlockNode(org.w3c.dom.Node node)
Is this node a block tag?

printAttr

public java.lang.StringBuffer printAttr(org.w3c.dom.Node node1)
Maybe this is only used for testing

makeIfChoice

public java.lang.StringBuffer makeIfChoice(org.w3c.dom.Node node)
                                    throws AhaException
This method gets an if-tag and depending on the expression returns a block if if-expr=true --> first block (item(0)) if if-expr=false --> second block if any (item((1))

doHeaderFooter

public java.lang.StringBuffer doHeaderFooter(org.w3c.dom.Node node)
                                      throws AhaException
This method takes care of writing headers and footers, which consists of calling to the Messages object

filterAnchorNode

public java.lang.String filterAnchorNode(org.w3c.dom.Node node)
                                  throws AhaException
This returns a string containing an anchor

printNode

public java.lang.StringBuffer printNode(org.w3c.dom.Node node,
                                        boolean b)
                                 throws AhaException
Get the (html) representation of this node
Parameters:
b - if b then generate something, else generate nothing

printChildNodes

public java.lang.StringBuffer printChildNodes(org.w3c.dom.Node nodec,
                                              boolean b)
                                       throws AhaException
Get the (html) representation of the childs of this node
Parameters:
b - pass this boolean to printNode

run

public void run()
         throws AhaException
prints out the html to AHA.getWriter