[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

RE: [TEKNIK] HTML formatter



> > >
> > >>Hvad med tidy? Det er skrevet i C, og findes, svjv, i både
> > >>dynamisk og statisk linkede versioner.
> > >>
> > >
> > > Eller du kan lave en statisk linket version selv, da det
> > > selvfølgelig er open source.
> >
> > Ahh, den havde jeg glemt/overset.  Checker i morgen..
> 
> Jeg er spændt på at høre, hvad du kommer frem til. Den nyeste
> Tidy jeg kan finde er fra 2010, men ligner de gamle: Den kan
> ikke acceptere fejl i HTML dokumenter:
> [...]
> line 305 column 1 - Error: discarding unexpected </font>
> 193 warnings, 6 errors were found!
> 
> This document has errors that must be fixed before
> using HTML Tidy to generate a tidied up version.
> 
> You may need to move one or both of the <form> and </form>
> tags. HTML elements should be properly nested and form elements
> are no exception. [---]
> 
> Der er godt nok forklaringer af hvad det er "den ikke kan lide"
> men det er måske ikke lige det tool, man har brug for, hvis man
> skal rescue/redde en webservice med 300+ filer.
> 
> Jeg har engang prøvet at skrive en "loose" parser som accepterer
> visse fejl, men det griber hurtig om sig og det lykkedes kun lidt +
> at det kræver tid at vedligeholde/forbedre. Jeg kan huske at nogen,
> vistnok Peter Toft, foreslog at jeg prøvede at bygge en med
> en xml-parser eller yacc. Det bliver næste projekt, jeg tror
> det vil være nyttigt :)
> 



Prøv at bruge xmllint i stedet for at lave din egen xml-parser

Dagligt anvender jeg xmllint til at validere og formatere xml-filer.


xmllint har også mulighed for at parse html, men jeg har ikke brugt programmet til det.

En hurtig test, hvor jeg lavede nogle stavefejl i tags samt udelod andre, blev disse fejl rettet.

Fejl rettet i hmtl: "Glemt" <body> + stavefejl i </pre> + </body> + </html>

Syntaks til at rette html: xmllint --html --htmlout --recover xyz.html > zyx.html


Med venlig hilsen / Regards

Frank Larsen
Kimik IT A/S
PO Box 740
3900 Nuuk
Greenland
Mail : sslug@sslug
Phone: +299 34 20 00



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2011-12-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *