[Htmlparser-cvs] htmlparser/docs/docs TagFindingVisitor.html,NONE,1.1 CustomTagExtraction.html,1.3,1
Brought to you by:
derrickoswald
Update of /cvsroot/htmlparser/htmlparser/docs/docs In directory sc8-pr-cvs1:/tmp/cvs-serv8640/htmlparser/docs/docs Modified Files: CustomTagExtraction.html FrequentlyAskedQuestions.html PatternStories.html WritingYourOwnScanners.html Added Files: TagFindingVisitor.html Log Message: Updated Wiki docs. --- NEW FILE: TagFindingVisitor.html --- <html><head><title>Tag Finding Visitor</title></head><body><DIV CLASS="wikitext"> <P>Describe <A CLASS="wiki" HREF="TagFindingVisitor.html">TagFindingVisitor</A> here.</P></DIV><DIV ID="actionbar" CLASS="toolbar"><HR NOSHADE="noshade" CLASS="printer"/><P CLASS="editdate">Last edited on Tuesday, May 6, 2003 1:43:25 am.</P><HR NOSHADE="noshade" CLASS="toolbar"/></body></html> Index: CustomTagExtraction.html =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/docs/docs/CustomTagExtraction.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CustomTagExtraction.html 26 Apr 2003 03:58:34 -0000 1.3 --- CustomTagExtraction.html 25 May 2003 19:30:14 -0000 1.4 *************** *** 1,5 **** <html><head><title>Custom Tag Extraction</title></head><body><DIV CLASS="wikitext"> <P><B>Custom Tag Extraction</B></P> ! <P>Custom tag extraction is easy. Simply create an array of tag names that you want to extract from a page, and pass it in to <SPAN CLASS="wikiunknown"><U>TagFindingVisitor</U></SPAN>, like so :</P> <PRE>Parser parser = new Parser(..); String [] tagsToBeFound = {"P","BR","MYTAG"}; --- 1,5 ---- <html><head><title>Custom Tag Extraction</title></head><body><DIV CLASS="wikitext"> <P><B>Custom Tag Extraction</B></P> ! <P>Custom tag extraction is easy. Simply create an array of tag names that you want to extract from a page, and pass it in to <A CLASS="wiki" HREF="TagFindingVisitor.html">TagFindingVisitor</A>, like so :</P> <PRE>Parser parser = new Parser(..); String [] tagsToBeFound = {"P","BR","MYTAG"}; Index: FrequentlyAskedQuestions.html =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/docs/docs/FrequentlyAskedQuestions.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FrequentlyAskedQuestions.html 26 Apr 2003 03:58:34 -0000 1.2 --- FrequentlyAskedQuestions.html 25 May 2003 19:30:14 -0000 1.3 *************** *** 2,4 **** <P><B>FAQ</B></P><HR/> <P><B>How does the parser deal with tags like <tag/> ?</B></P> ! <P>The parser handles them as a normal Tag object. The Tag class has a method - isEmptyXmlTag() which can be queried to find if this an empty xml tag.</P><HR/></DIV><DIV ID="actionbar" CLASS="toolbar"><HR NOSHADE="noshade" CLASS="printer"/><P CLASS="editdate">Last edited on Sunday, March 23, 2003 5:05:28 pm.</P><HR NOSHADE="noshade" CLASS="toolbar"/></body></html> \ No newline at end of file --- 2,5 ---- <P><B>FAQ</B></P><HR/> <P><B>How does the parser deal with tags like <tag/> ?</B></P> ! <P>The parser handles them as a normal Tag object. The Tag class has a method - isEmptyXmlTag() which can be queried to find if this an empty xml tag. ! ----s</P></DIV><DIV ID="actionbar" CLASS="toolbar"><HR NOSHADE="noshade" CLASS="printer"/><P CLASS="editdate">Last edited on Sunday, May 18, 2003 2:57:52 am.</P><HR NOSHADE="noshade" CLASS="toolbar"/></body></html> \ No newline at end of file Index: PatternStories.html =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/docs/docs/PatternStories.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PatternStories.html 26 Apr 2003 03:58:35 -0000 1.2 --- PatternStories.html 25 May 2003 19:30:14 -0000 1.3 *************** *** 10,12 **** <LI><A CLASS="wiki" HREF="StrategyPattern.html">StrategyPattern</A></LI> <LI><A CLASS="wiki" HREF="CompositePattern.html">CompositePattern</A></LI></UL> ! <P>--<A CLASS="wiki" HREF="SomikRaha.html">SomikRaha</A></P></DIV><DIV ID="actionbar" CLASS="toolbar"><HR NOSHADE="noshade" CLASS="printer"/><P CLASS="editdate">Last edited on Sunday, February 16, 2003 4:50:00 pm.</P><HR NOSHADE="noshade" CLASS="toolbar"/></body></html> \ No newline at end of file --- 10,12 ---- <LI><A CLASS="wiki" HREF="StrategyPattern.html">StrategyPattern</A></LI> <LI><A CLASS="wiki" HREF="CompositePattern.html">CompositePattern</A></LI></UL> ! <P>--<A CLASS="wiki" HREF="SomikRaha.html">SomikRaha</A></P></DIV><DIV ID="actionbar" CLASS="toolbar"><HR NOSHADE="noshade" CLASS="printer"/><P CLASS="editdate">Last edited on Friday, May 16, 2003 2:30:12 pm.</P><HR NOSHADE="noshade" CLASS="toolbar"/></body></html> \ No newline at end of file Index: WritingYourOwnScanners.html =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/docs/docs/WritingYourOwnScanners.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WritingYourOwnScanners.html 26 Apr 2003 03:58:35 -0000 1.3 --- WritingYourOwnScanners.html 25 May 2003 19:30:14 -0000 1.4 *************** *** 4,14 **** <UL> <LI><A CLASS="wiki" HREF="TagScanner.html">TagScanner</A> - for parsing tags that have no child elements</LI> ! <LI><SPAN CLASS="wikiunknown"><U>CompositeTagScanner</U></SPAN> - for parsing tags with children</LI></UL> <P>Your scanner should subclass either of these two classes. You should then register your scanner with the parser with a call like: ! parser.addScanner(new <SPAN CLASS="wikiunknown"><U>MyOwnScanner</U></SPAN>());</P> <P><B>The Anatomy of a Scanner</B></P> ! <P>The scanner allows you to customize parts of the scanning process. The scanning process is :<BR/><BR/>1. Given a tag, match the tag name with a registered scanner<BR/><BR/>2. If a match is found (using getId()- which you MUST override), a closer match or special processing can be done by calling the evaluate() method of the scanner. This is optional, subclasses don't have to override the evaluate() method.<BR/><BR/>3. If a match was found, call the scan() method. For both <A CLASS="wiki" HREF="TagScanner.html">TagScanner</A> and <SPAN CLASS="wikiunknown"><U>CompositeTagScanner</U></SPAN>, overriding this method is optional, and NOT recommended for standard cases. The default scan() methods will make a call to createTag.<BR/><BR/>4. createTag describes the creation of a new tag. This method MUST be overridden in your scanner.<BR/><BR/></P> <P><B>For your own scanner - simply override</B> :<BR/><BR/>1. getID() and have it return an array of strings that will be matched against the tag. For most cases, a single string is enough.<BR/><BR/>2. createTag() and have it create your special tag. The data needed for construction of your tag will be within tagData and compositeTagData (mostly within the latter if you are creating a composite tag - a tag with children).<BR/><BR/></P> ! <P>Note: Tags with children must subclass <SPAN CLASS="wikiunknown"><U>CompositeTag</U></SPAN></P> <P><B>Examples</B></P> <P>1. Simple tag with no children</P> --- 4,14 ---- <UL> <LI><A CLASS="wiki" HREF="TagScanner.html">TagScanner</A> - for parsing tags that have no child elements</LI> ! <LI>CompositeTagScanner - for parsing tags with children</LI></UL> <P>Your scanner should subclass either of these two classes. You should then register your scanner with the parser with a call like: ! parser.addScanner(new MyOwnScanner());</P> <P><B>The Anatomy of a Scanner</B></P> ! <P>The scanner allows you to customize parts of the scanning process. The scanning process is :<BR/><BR/>1. Given a tag, match the tag name with a registered scanner<BR/><BR/>2. If a match is found (using getId()- which you MUST override), a closer match or special processing can be done by calling the evaluate() method of the scanner. This is optional, subclasses don't have to override the evaluate() method.<BR/><BR/>3. If a match was found, call the scan() method. For both <A CLASS="wiki" HREF="TagScanner.html">TagScanner</A> and CompositeTagScanner, overriding this method is optional, and NOT recommended for standard cases. The default scan() methods will make a call to createTag.<BR/><BR/>4. createTag describes the creation of a new tag. This method MUST be overridden in your scanner.<BR/><BR/></P> <P><B>For your own scanner - simply override</B> :<BR/><BR/>1. getID() and have it return an array of strings that will be matched against the tag. For most cases, a single string is enough.<BR/><BR/>2. createTag() and have it create your special tag. The data needed for construction of your tag will be within tagData and compositeTagData (mostly within the latter if you are creating a composite tag - a tag with children).<BR/><BR/></P> ! <P>Note: Tags with children must subclass CompositeTag</P> <P><B>Examples</B></P> <P>1. Simple tag with no children</P> *************** *** 57,59 **** } }</PRE> ! <P>You can customize the composite tag with an array of tag(strings) which indicate when to trigger corrections. You can also specify if you wish to prevent the same tag from appear as its child. Check the javadocs of <SPAN CLASS="wikiunknown"><U>CompositeTagScanner</U></SPAN> for more info.</P></DIV><DIV ID="actionbar" CLASS="toolbar"><HR NOSHADE="noshade" CLASS="printer"/><P CLASS="editdate">Last edited on Sunday, April 13, 2003 4:33:18 pm.</P><HR NOSHADE="noshade" CLASS="toolbar"/></body></html> \ No newline at end of file --- 57,59 ---- } }</PRE> ! <P>You can customize the composite tag with an array of tag(strings) which indicate when to trigger corrections. You can also specify if you wish to prevent the same tag from appear as its child. Check the javadocs of CompositeTagScanner for more info.</P></DIV><DIV ID="actionbar" CLASS="toolbar"><HR NOSHADE="noshade" CLASS="printer"/><P CLASS="editdate">Last edited on Thursday, May 1, 2003 6:54:01 pm.</P><HR NOSHADE="noshade" CLASS="toolbar"/></body></html> \ No newline at end of file |