RE: Allowing other tags...

Hans Deragon [mailto:deragon@aqiii.org] wrote:
> I want to build a template driven system for processing html files.
> New tags are placeholders and instructions for how to manipulate the 
> html files.
> 
> And I want these tags to be in xml format.  I then pass the 
> html files 
> through jtidy
> to make them xml compliant.  Then, using DOM functionnality, I can 
> manipulate
> easily the different html and resolve their dependencies.  I 
> then create 
> a new
> XML structure resulting from the merging of many files, and use this 
> structure
> to generate the final static page (I might pass this final 
> static page 
> again through
> jtidy).
> 
> Its not the most efficient way of doing, but I am not seeking most 
> efficiency CPU
> or memory wise.  I am seeking for the most efficient use of existing 
> code, keeping
> maintenance easy, etc...  Using jtidy, I have no parsing to do!  It 
> provides me
> the DOM document of my HTML pages (hopefully with my tags 
> intact).  Then
> I only have to play with the Nodes, replacing them, deleting 
> them, etc.. 
> to get
> the final structure.

FWIW:  I haven't necessarily done the above but we do add some tags to HTML
files that give us some additional information about the files.  We do this
by adding <div> and <span> tags with very specific attributes so that these
<div> and <span> tags are not confused with existing tags.  This means we do
not have to have any new tags that tidy does not support.  Here is a short
example:

<div title="myConfigInfo">
	<span title="color">red</span>
	<span title="size">medium</span>
</div>

Then when we are using the DOM/XSLT, we just select these elements with:
//div[@title='myConfigInfo]/span[@title="color"]

Just thought this might help make your job a bit easier by not having to
modify how tidy works.

Received on Friday, 16 November 2001 11:11:59 UTC