henryturnerlists@googlemail.com
10/7/2008 2:28:00 PM
Well, I suppose there are incorrectly formatted links too... I was
talking about correctly formatted links that point to a 400+ status
code resource. Something libxml would not pick up since I guess you're
talking about its syntax checking bit.
Since the entire document is accessible from the Hpricot::Elem it
seems plausible to count the characters up to and after the element. A
15min look at the source didn't reveal anything obvious.. Have a nasty
feeling that this type of thing would have to be done in the compiled
C section of it..
On Oct 7, 2:53=A0pm, Mark Thomas <m...@thomaszone.com> wrote:
> On Oct 7, 3:58=A0am, "henryturnerli...@googlemail.com"
>
> <henryturnerli...@googlemail.com> wrote:
> > Hi Mark,
>
> > I'm writing a broken link reporting type tool. When I find a dodgy tag
> > I'd like to be able to relay the character position and or line number
> > to the user. Useful for debugging.
>
> So, are you really interested in broken *links* (as in a GET does not
> return a 200 result code) or broken HTML? I have done the former via
> AJAX (jQuery sends links to a backend rails action, and if it is
> broken changes the class of the link to display a red background). The
> latter may be able to be done with libxml, which reports the character
> position of broken input.
>
> -- Mark.