Re: Image size error reporting

Let me make sure I understand:

Re 1 & 2. After we build the moki document, from the DOM tree of the
original  document,  the moki is represented as a Java Document tree. At
this point, we invoke the java Transformer Factory to use the XSL files to
translate the moki document into a results document. You want to
reparse/rebuild the moki dom tree into a Saxon tree so that we can gain line
numbers from that tree when we feed it to the Transformer Factory? This
would be performed by getting the String representation of the moki Document
tree and then reparsing that string using Saxon.

Re 3. From the resulting moki document, we can get line numbers using a
helper function. This helper function:
- determines value a = the line number in the moki doc of the location of
the original content of the xhtml file
- determines value b = the line number of the node where the error occurred
- returns the relative line number: b-a

There are only a couple extra cases I anticipate. 1) I don't know exactly
how the CSS is being processed/represented.  If we want to report line
numbers of errors in CSS (which I think we decided we wanted to),  is the
original text of the CSS contained in the moki? If it is, that should be a
pretty simple fix. 2) We don't include all of the xhtml for the docContent
of the moki. We only record docContent starting at the beginning of the html
tag, which leaves out encoding and doctype. Seeing as how this information
is at the top of the file, I don't think it would be hard for the user to
find and correct, but we could also include these lines into the docContent?

If I'm understanding everything correctly, I'll try out this solution ASAP.

Cheers,
Laura




On 7/13/07, Sean Owen <srowen@google.com> wrote:
>
> Laura, do you have time to take a crack at this change?  Here's my
> quick take on the essential ingredients:
>
> 1. Right now we build a DOM manually, and serialize it, but also pass
> it directly to the XSLTs. Now we have to serialize it, then reparse it
> from a String representation.
> 2. We gotta use Saxon for the moki parsing since it alone supports line
> numbers
> 3. The helper function to determine line number needs to subtract from
> what it finds the line number on which the document starts within
> moki, per Jo's suggestion
>
> Sean
>
> On 7/13/07, Roland Gülle <roland@7val.com> wrote:
> >
> > > > Also, I'm still not quite sure what we determined about the
> > > > position information format for error reporting. Roland, are you
> > > > working on that?
> > > No (sorry for this late feedback for this short feedback).
> > > I try to add this feature at the weekend...
> > relating to the current discussion about 'the line number problem',
> > I'm waiting for a solution with implementing any feature.
> >
> > Cheers,
> >   Roland
> >
> >
> >
>

Received on Friday, 13 July 2007 16:11:02 UTC