Re: adding tags in JTidy

Michael --

You have a few ways to go.  Since JTidy is open source, you can hack up
the source yourself to automatically do something with unrecognized
tags.  This may even be a feature request for HTML Tidy, which you can
check on the SourceForge site.

Or, you can have a look at what TagTable.java does for
  defineInlineTag
  defineBlockTag
  defineEmptyTag
  definePreTag

and create the Dict object and install it in the TagTable yourself. 
You'll somehow need to decide what kind of tag the unrecognized tag is.

Gary

Michael Ryan Bannon wrote:
> 
> Thanks...one more question
> 
> Is there a method I can call from Tidy that takes the actual tag as the
> argument?
> Here's the situation: i'm using JTidy in my own Java app to clean a file.
> JTidy finds a tag it doesn't recognize and gives me an error.  So, I get the
> unknown tag from that error and attempt to let JTidy know that it SHOULD
> recognize this tag.
> I guess what I'm saying is, I want to make sure I find this easiest, most
> elegent way to handle this.
> 
> thanks,
> 
> ryan
> 
> Gary L Peskin wrote:
> 
> > Michael --
> >
> > The config file is the same config file in both HTML Tidy and JTidy.  If
> > you're not using the command line, you can set the config file in JTidy
> > with Tidy.setConfigurationFromFile(String filename).
> >
> > Gary
> >
> > Michael Ryan Bannon wrote:
> > >
> > > Hello all,
> > >
> > > i know in HTMLTidy you can set your config file to recognize unknown
> > > tags by specifying those tags.  Is there a similar option in JTidy?  I
> > > couldn't find one, but such an option would be great.
> > >
> > > thanks,
> > >
> > > ryan

Received on Monday, 20 August 2001 14:55:09 UTC