Connecting Tech Pros Worldwide Forums | Help | Site Map

Bad HTML tag format

NickName
Guest
 
Posts: n/a
#1: Aug 1 '06

I have a bunch of HTML files with nasty tag format, see below,

bad format example (untidy tags)
<DIV class="Sect"
Quote:
><H3
align="left"
Quote:
><FONT size="+1" color="#000000"><B>Products...As-Is...Business Line... Information Technology: Monitor, Report, & Respond </H3
><P
align="left"
Quote:
></B</P
><TABLE
border=1 cellspacing=0 cellpadding=2
Quote:
><TR
know any tool that could tidy it up?

tia.

Sherm Pendley
Guest
 
Posts: n/a
#2: Aug 1 '06

re: Bad HTML tag format


"NickName" <dadada@rock.comwrites:
Quote:
know any tool that could tidy it up?
Ummm... tidy. :-)

<http://www.w3.org/People/Raggett/tidy/>

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
Chris Morris
Guest
 
Posts: n/a
#3: Aug 1 '06

re: Bad HTML tag format


"NickName" <dadada@rock.comwrites:
Quote:
I have a bunch of HTML files with nasty tag format, see below,
>
bad format example (untidy tags)
] <DIV class="Sect"
]
] ><H3
] align="left"
] ><FONT size="+1" color="#000000"><B>Products...As-Is...Business Line... Information Technology: Monitor, Report, & Respond </H3
] ><P
] align="left"
] ></B</P
] ><TABLE
] border=1 cellspacing=0 cellpadding=2
] ><TR
Quote:
>
know any tool that could tidy it up?
Depends which bit needs tidying up. If you mean the newlines before
the at the end of the tag, then various programs could do it. I'd
probably use perl for it, but anything with reasonably good
search-and-replace could do it. Alternatively, there's various
programs that will automatically reformat HTML code (tinyMCE will do
it, though it obviously isn't the primary use)

If you mean the fact that a <fontelement:
a) is in there at all
b) is never closed
and the attempted <belement has an opening tag inside the <h3>
element and a closing tag inside the <pelement, then you might have
some luck running it through HTML tidy or other code cleanup programs,
but more likely it'll have to be done manually to get it fully sorted
out, depending on how widespread the problems of that sort are.

--
Chris
NickName
Guest
 
Posts: n/a
#4: Aug 1 '06

re: Bad HTML tag format


Thanks. Tidy seems to do the trick. Nice!

Sherm Pendley wrote:
Quote:
"NickName" <dadada@rock.comwrites:
>
Quote:
know any tool that could tidy it up?
>
Ummm... tidy. :-)
>
<http://www.w3.org/People/Raggett/tidy/>
>
sherm--
>
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
NickName
Guest
 
Posts: n/a
#5: Aug 1 '06

re: Bad HTML tag format


Chris,

Sherm Pendley's recommendation of Tidy has solved the problem so far.
Thanks though.

Don

Chris Morris wrote:
Quote:
"NickName" <dadada@rock.comwrites:
Quote:
I have a bunch of HTML files with nasty tag format, see below,

bad format example (untidy tags)
] <DIV class="Sect"
]
] ><H3
] align="left"
] ><FONT size="+1" color="#000000"><B>Products...As-Is...Business Line... Information Technology: Monitor, Report, & Respond </H3
] ><P
] align="left"
] ></B</P
] ><TABLE
] border=1 cellspacing=0 cellpadding=2
] ><TR
Quote:

know any tool that could tidy it up?
>
Depends which bit needs tidying up. If you mean the newlines before
the at the end of the tag, then various programs could do it. I'd
probably use perl for it, but anything with reasonably good
search-and-replace could do it. Alternatively, there's various
programs that will automatically reformat HTML code (tinyMCE will do
it, though it obviously isn't the primary use)
>
If you mean the fact that a <fontelement:
a) is in there at all
b) is never closed
and the attempted <belement has an opening tag inside the <h3>
element and a closing tag inside the <pelement, then you might have
some luck running it through HTML tidy or other code cleanup programs,
but more likely it'll have to be done manually to get it fully sorted
out, depending on how widespread the problems of that sort are.
>
--
Chris
Closed Thread