[Tests] automated Tests for FOP's XSL-Standard compilance

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[Tests] automated Tests for FOP's XSL-Standard compilance

Matthias Wessendorf
Hi there,

are there any (unit) tests regarding FOP's standard compilance?

I'd like to document the FOP behaivor when it becomes an input file that contains a <fo:table/> with NO table-layout="fixed".
So in my case (not a test case (yet)) I saw a PDF file on my disk (so "out.size() > 0" is true ;)), but that guy is empty, since
FOP isn't able to process that <fo:table/>. Such a test case would be fine to create automated test on my development cases.

I am using/evaluating (better testing?) some converters (html2fo and css2xslfo) to produce FO files from (x)html files. And that pain I would like to automate ;)

Any ideas? Or perhaps existing test cases ? ;)

Thanks and regards,
Matthias
Reply | Threaded
Open this post in threaded view
|

Re: [Tests] automated Tests for FOP's XSL-Standard compilance

Jeremias Maerki
Hi Matthias

On 06.06.2005 10:41:37 Matthias Wessendorf wrote:
> Hi there,
>
> are there any (unit) tests regarding FOP's standard compilance?

We've started a systematic test suite for FOP 1.0dev development. It's
located here:

http://cvs.apache.org/viewcvs.cgi/xml-fop/test/layoutengine/

Some initial documentation is here:
http://wiki.apache.org/xmlgraphics-fop/HowToCreateLayoutEngineTests

Please note that the checks are specific to the development code for FOP
(CVS HEAD) and do not apply to FOP 0.20.5. However, I frequently
cross-check the results with different FO implementations if only to see
that they fail in many tests that FOP already handles fine. *evil grin*

> I'd like to document the FOP behaivor when it becomes an input file that
> contains a <fo:table/> with NO table-layout="fixed".
> So in my case (not a test case (yet)) I saw a PDF file on my disk (so
> "out.size() > 0" is true ;)), but that guy is empty, since
> FOP isn't able to process that <fo:table/>. Such a test case would be
> fine to create automated test on my development cases.

According to the spec an empty fo:table element is illegal. It has to
contain at least one fo:table-body element.

If you like to help extend the test suite, that would be absolutely great!
Just be aware that it doesn't make sense to document what FOP 0.20.5
doesn't do well since that is already documented quite well in the
compliance document on FOP's website and the maintenance branch has been
frozen. But if there are things that FOP 0.20.5 and (!) FOP 1.0dev fail
to do then it would be good to have test cases if just as a reminder for
things that still need to be done.

Glen Mazza mentioned a couple of months ago, that the W3C working group
for XSL also seeks to create a test suite. Maybe they already have
something. I don't know. The old test suite at least is quite outdated
and wasn't updated to the Recommendation level.

> I am using/evaluating (better testing?) some converters (html2fo and
> css2xslfo) to produce FO files from (x)html files. And that pain I
> would like to automate ;)

I don't know if it helps you in this particular case but I've written a
general Java API for converting XML documents to graphical output
(XSL-FO, SVG, XHTML to PDF, PS, SVG or whatever). I haven't published it
since I renamed the whole beast (now JAXG, formerly JAFOP), but I expect
to do that this month. I already use it to do all my private test code
for FOP. I can send you a snapshot if you're interested. I've got
implementations for FOP 0.20.5, FOP 1.0dev, FOray, JFOR and Batik. Write
once, use whatever implementation you would like, basically. Of course,
the conversion of HTML to XSL-FO is outside the scope of JAXG since it's
a process that happens before the actual conversion of the XML dialect
to the final graphical format. But maybe preprocessors like the above
two could be somehow integrated. I'd have to think about that a little,
though.

> Any ideas? Or perhaps existing test cases ? ;)

In the end I think what you really need is support for auto table layout
which neither FOP 0.20.5 and FOP 1.0dev support, yet. When converting
HTML to PDF this automatically comes up. At some point someone has to
start implementing this feature and it's likely not going to be me since
I'm into strict XSL-FO business document where this was never an issue,
yet.

I hope the above helps.

Jeremias Maerki

Reply | Threaded
Open this post in threaded view
|

RE: [Tests] automated Tests for FOP's XSL-Standard compilance

Matthias Wessendorf
In reply to this post by Matthias Wessendorf
Hi,

see comments inline

> We've started a systematic test suite for FOP 1.0dev development. It's
> located here:
>
> http://cvs.apache.org/viewcvs.cgi/xml-fop/test/layoutengine/
>
> Some initial documentation is here:
> http://wiki.apache.org/xmlgraphics-fop/HowToCreateLayoutEngineTests

thanks, I'll take a look at that pages.

> > I'd like to document the FOP behaivor when it becomes an
> input file that
> > contains a <fo:table/> with NO table-layout="fixed".
> > So in my case (not a test case (yet)) I saw a PDF file on
> my disk (so
> > "out.size() > 0" is true ;)), but that guy is empty, since
> > FOP isn't able to process that <fo:table/>. Such a test
> case would be
> > fine to create automated test on my development cases.
>
> According to the spec an empty fo:table element is illegal. It has to
> contain at least one fo:table-body element.

sure I more meant a (valid) table, which doesn't contain a table-layout attribute;

> frozen. But if there are things that FOP 0.20.5 and (!) FOP
> 1.0dev fail

is FOP 1.0dev able to process <fo:table> elements that do not contain
table-layout="fixed" ?


> I don't know if it helps you in this particular case but I've
> written a
> general Java API for converting XML documents to graphical output
> (XSL-FO, SVG, XHTML to PDF, PS, SVG or whatever). I haven't
> published it
> since I renamed the whole beast (now JAXG, formerly JAFOP),
> but I expect
> to do that this month. I already use it to do all my private test code
> for FOP. I can send you a snapshot if you're interested. I've got
> implementations for FOP 0.20.5, FOP 1.0dev, FOray, JFOR and
> Batik. Write

that sounds fine to me, will this be released under the umbrella of xmlgraphics project of the
ASF ?

> once, use whatever implementation you would like, basically.
> Of course,
> the conversion of HTML to XSL-FO is outside the scope of JAXG
> since it's
> a process that happens before the actual conversion of the XML dialect
> to the final graphical format. But maybe preprocessors like the above
> two could be somehow integrated. I'd have to think about that
> a little,
> though.



> > Any ideas? Or perhaps existing test cases ? ;)
>
> In the end I think what you really need is support for auto
> table layout
> which neither FOP 0.20.5 and FOP 1.0dev support, yet. When converting

ok... that would be a *killer* feature for me ;)

> HTML to PDF this automatically comes up. At some point someone has to
> start implementing this feature and it's likely not going to

do you know more details regarding the implementation of this feature?

Thanks for your informations,
Matthias

> be me since
> I'm into strict XSL-FO business document where this was never
> an issue,
> yet.
>
> I hope the above helps.
>
> Jeremias Maerki
>
>
Reply | Threaded
Open this post in threaded view
|

RE: [Tests] automated Tests for FOP's XSL-Standard compilance

Matthias Wessendorf
In reply to this post by Matthias Wessendorf
Hi Jeremias,

I just looked at exsisting base of test cases. I had to disable some
footnotes xml. And also text-transform1|2 . xml

After the the unit test for layout engine works fine for me (BUILD SUCCESSFUL)

Is that a known issue?

Matthias

> -----Original Message-----
> From: Matthias Wessendorf [mailto:[hidden email]]
> Sent: Monday, June 06, 2005 1:30 PM
> To: [hidden email]
> Subject: RE: [Tests] automated Tests for FOP's XSL-Standard compilance
>
>
> Hi,
>
> see comments inline
>
> > We've started a systematic test suite for FOP 1.0dev
> development. It's
> > located here:
> >
> > http://cvs.apache.org/viewcvs.cgi/xml-fop/test/layoutengine/
> >
> > Some initial documentation is here:
> > http://wiki.apache.org/xmlgraphics-fop/HowToCreateLayoutEngineTests
>
> thanks, I'll take a look at that pages.
>
> > > I'd like to document the FOP behaivor when it becomes an
> > input file that
> > > contains a <fo:table/> with NO table-layout="fixed".
> > > So in my case (not a test case (yet)) I saw a PDF file on
> > my disk (so
> > > "out.size() > 0" is true ;)), but that guy is empty, since
> > > FOP isn't able to process that <fo:table/>. Such a test
> > case would be
> > > fine to create automated test on my development cases.
> >
> > According to the spec an empty fo:table element is illegal.
> It has to
> > contain at least one fo:table-body element.
>
> sure I more meant a (valid) table, which doesn't contain a
> table-layout attribute;
>
> > frozen. But if there are things that FOP 0.20.5 and (!) FOP
> > 1.0dev fail
>
> is FOP 1.0dev able to process <fo:table> elements that do not contain
> table-layout="fixed" ?
>
>
> > I don't know if it helps you in this particular case but I've
> > written a
> > general Java API for converting XML documents to graphical output
> > (XSL-FO, SVG, XHTML to PDF, PS, SVG or whatever). I haven't
> > published it
> > since I renamed the whole beast (now JAXG, formerly JAFOP),
> > but I expect
> > to do that this month. I already use it to do all my
> private test code
> > for FOP. I can send you a snapshot if you're interested. I've got
> > implementations for FOP 0.20.5, FOP 1.0dev, FOray, JFOR and
> > Batik. Write
>
> that sounds fine to me, will this be released under the
> umbrella of xmlgraphics project of the
> ASF ?
>
> > once, use whatever implementation you would like, basically.
> > Of course,
> > the conversion of HTML to XSL-FO is outside the scope of JAXG
> > since it's
> > a process that happens before the actual conversion of the
> XML dialect
> > to the final graphical format. But maybe preprocessors like
> the above
> > two could be somehow integrated. I'd have to think about that
> > a little,
> > though.
>
>
>
> > > Any ideas? Or perhaps existing test cases ? ;)
> >
> > In the end I think what you really need is support for auto
> > table layout
> > which neither FOP 0.20.5 and FOP 1.0dev support, yet. When
> converting
>
> ok... that would be a *killer* feature for me ;)
>
> > HTML to PDF this automatically comes up. At some point
> someone has to
> > start implementing this feature and it's likely not going to
>
> do you know more details regarding the implementation of this feature?
>
> Thanks for your informations,
> Matthias
>
> > be me since
> > I'm into strict XSL-FO business document where this was never
> > an issue,
> > yet.
> >
> > I hope the above helps.
> >
> > Jeremias Maerki
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: [Tests] automated Tests for FOP's XSL-Standard compilance

Jeremias Maerki
In reply to this post by Matthias Wessendorf

On 06.06.2005 13:29:30 Matthias Wessendorf wrote:

> Hi,
>
> see comments inline
>
> > We've started a systematic test suite for FOP 1.0dev development. It's
> > located here:
> >
> > http://cvs.apache.org/viewcvs.cgi/xml-fop/test/layoutengine/
> >
> > Some initial documentation is here:
> > http://wiki.apache.org/xmlgraphics-fop/HowToCreateLayoutEngineTests
>
> thanks, I'll take a look at that pages.
>
> > > I'd like to document the FOP behaivor when it becomes an
> > input file that
> > > contains a <fo:table/> with NO table-layout="fixed".
> > > So in my case (not a test case (yet)) I saw a PDF file on
> > my disk (so
> > > "out.size() > 0" is true ;)), but that guy is empty, since
> > > FOP isn't able to process that <fo:table/>. Such a test
> > case would be
> > > fine to create automated test on my development cases.
> >
> > According to the spec an empty fo:table element is illegal. It has to
> > contain at least one fo:table-body element.
>
> sure I more meant a (valid) table, which doesn't contain a table-layout attribute;
>
> > frozen. But if there are things that FOP 0.20.5 and (!) FOP
> > 1.0dev fail
>
> is FOP 1.0dev able to process <fo:table> elements that do not contain
> table-layout="fixed" ?

The table-layout property is currently ignored. Furthermore, without
table-column elements the column setup is not really usable right now,
as the first column takes up 100% of the available width. In the end you
currently have the same problem as in 0.20.5.

> > I don't know if it helps you in this particular case but I've
> > written a
> > general Java API for converting XML documents to graphical output
> > (XSL-FO, SVG, XHTML to PDF, PS, SVG or whatever). I haven't
> > published it
> > since I renamed the whole beast (now JAXG, formerly JAFOP),
> > but I expect
> > to do that this month. I already use it to do all my private test code
> > for FOP. I can send you a snapshot if you're interested. I've got
> > implementations for FOP 0.20.5, FOP 1.0dev, FOray, JFOR and
> > Batik. Write
>
> that sounds fine to me, will this be released under the umbrella of xmlgraphics project of the
> ASF ?

I don't intend to. It would send the wrong signal. I've already renamed
the API to avoid "FOP" in the name, so I don't scare potential
commercial implementors away. It's probably going to end up on java.net.
But it's Apache v2 licensed, just like FOP. The intention is to have as
many implementations as possible to make it easier to switch between
different XSL-FO implementations without modifying too much in Java code.

> > once, use whatever implementation you would like, basically.
> > Of course,
> > the conversion of HTML to XSL-FO is outside the scope of JAXG
> > since it's
> > a process that happens before the actual conversion of the XML dialect
> > to the final graphical format. But maybe preprocessors like the above
> > two could be somehow integrated. I'd have to think about that
> > a little,
> > though.
>
>
>
> > > Any ideas? Or perhaps existing test cases ? ;)
> >
> > In the end I think what you really need is support for auto
> > table layout
> > which neither FOP 0.20.5 and FOP 1.0dev support, yet. When converting
>
> ok... that would be a *killer* feature for me ;)

I know. It would be for many people. Still looking for volunteers.

> > HTML to PDF this automatically comes up. At some point someone has to
> > start implementing this feature and it's likely not going to
>
> do you know more details regarding the implementation of this feature?

Depends on what you want to know. I can surely give pointers to someone
who would like to try implementing it. But I haven't invested too much
thought into how this would be done.

> Thanks for your informations,
> Matthias
>
> > be me since
> > I'm into strict XSL-FO business document where this was never
> > an issue,
> > yet.
> >
> > I hope the above helps.
> >
> > Jeremias Maerki
> >
> >



Jeremias Maerki

Reply | Threaded
Open this post in threaded view
|

Re: [Tests] automated Tests for FOP's XSL-Standard compilance

Jeremias Maerki
In reply to this post by Matthias Wessendorf
Yes, there are a few footnote tests that currently don't work. The
text-transform tests should work, though. What were the error messages
for text-transform? CVS HEAD is still a moving target and the file with
the disabled test cases may not always be up to date. But as it seems
you're of the flexible kind which is good. :-)

On 06.06.2005 14:13:23 Matthias Wessendorf wrote:
> Hi Jeremias,
>
> I just looked at exsisting base of test cases. I had to disable some
> footnotes xml. And also text-transform1|2 . xml
>
> After the the unit test for layout engine works fine for me (BUILD SUCCESSFUL)
>
> Is that a known issue?



Jeremias Maerki

Reply | Threaded
Open this post in threaded view
|

RE: [Tests] automated Tests for FOP's XSL-Standard compilance

Matthias Wessendorf
In reply to this post by Matthias Wessendorf
:)

here are all messages, I got (only on junit target (which are the interesting one))

HTH,
Matthias




junit:
     [echo] Running basic functionality tests for fop-transcoder.jar
    [junit] Testsuite: org.apache.fop.BasicTranscoderTestSuite
    [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 2,391 sec
     [echo] Running basic functionality tests for fop-transcoder-allinone.jar
    [junit] Testsuite: org.apache.fop.BasicTranscoderTestSuite
    [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 2,328 sec
     [echo] Running basic functionality tests for fop.jar
    [junit] Testsuite: org.apache.fop.BasicDriverTestSuite
    [junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 1,156 sec
    [junit] ------------- Standard Error -----------------
    [junit] 06.06.2005 15:12:31 org.apache.fop.render.rtf.RTFHandler <init>
    [junit] WARNUNG: WARNING: RTF renderer is veryveryalpha at this time, see class org.apache.fop.rtf.renderer.RTFHandler
    [junit] ------------- ---------------- ---------------
    [junit] Testsuite: org.apache.fop.UtilityCodeTestSuite
    [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0,078 sec
     [echo] Running layout engine tests
    [junit] Testsuite: org.apache.fop.layoutengine.LayoutEngineTestSuite
    [junit] Tests run: 100, Failures: 0, Errors: 1, Time elapsed: 9,047 sec
    [junit] ------------- Standard Error -----------------
    [junit] 06.06.2005 15:12:33 org.apache.fop.layoutmgr.TraitSetter addBackground
    [junit] WARNUNG: Horizontal background image positioning ignored
    [junit] 06.06.2005 15:12:33 org.apache.fop.layoutmgr.TraitSetter addBackground
    [junit] WARNUNG: Vertical background image positioning ignored
    [junit] 06.06.2005 15:12:34 org.apache.fop.layoutmgr.BlockContainerLayoutManager getNextKnuthElementsAbsolute
    [junit] WARNUNG: Contents overflow block-container viewport: clipping
    [junit] 06.06.2005 15:12:34 org.apache.fop.layoutmgr.BlockContainerLayoutManager getNextKnuthElementsAbsolute
    [junit] WARNUNG: Contents overflow block-container viewport: clipping
    [junit] 06.06.2005 15:12:34 org.apache.fop.layoutmgr.BlockContainerLayoutManager getNextKnuthElementsAbsolute
    [junit] WARNUNG: Contents overflow block-container viewport: clipping
    [junit] 06.06.2005 15:12:34 org.apache.fop.layoutmgr.BlockContainerLayoutManager getNextKnuthElementsAbsolute
    [junit] WARNUNG: Contents overflow block-container viewport: clipping
    [junit] 06.06.2005 15:12:37 org.apache.fop.layoutmgr.BlockContainerLayoutManager getNextKnuthElementsAbsolute
    [junit] WARNUNG: Contents overflow block-container viewport: clipping
    [junit] 06.06.2005 15:12:37 org.apache.fop.layoutmgr.BlockContainerLayoutManager getNextKnuthElementsAbsolute
    [junit] WARNUNG: Contents overflow block-container viewport: clipping
    [junit] 06.06.2005 15:12:37 org.apache.fop.layoutmgr.BlockContainerLayoutManager getNextKnuthElementsAbsolute
    [junit] WARNUNG: Contents overflow block-container viewport: clipping
    [junit] 06.06.2005 15:12:37 org.apache.fop.layoutmgr.BlockContainerLayoutManager getNextKnuthElementsAbsolute
    [junit] WARNUNG: Contents overflow block-container viewport: clipping
    [junit] 06.06.2005 15:12:37 org.apache.fop.layoutmgr.BlockContainerLayoutManager getNextKnuthElementsAbsolute
    [junit] WARNUNG: Contents overflow block-container viewport: clipping
    [junit] 06.06.2005 15:12:37 org.apache.fop.layoutmgr.BlockContainerLayoutManager getNextKnuthElementsAbsolute
    [junit] WARNUNG: Contents overflow block-container viewport: clipping
    [junit] 06.06.2005 15:12:38 org.apache.fop.layoutmgr.table.Cell addAreas
    [junit] WARNUNG: TODO Add collapsed border painting for spanned cells
    [junit] 06.06.2005 15:12:38 org.apache.fop.layoutmgr.table.Cell addAreas
    [junit] WARNUNG: TODO Add collapsed border painting for spanned cells
    [junit] 06.06.2005 15:12:38 org.apache.fop.layoutmgr.table.Cell addAreas
    [junit] WARNUNG: TODO Add collapsed border painting for spanned cells
    [junit] 06.06.2005 15:12:39 org.apache.fop.layoutmgr.table.Cell addAreas
    [junit] WARNUNG: TODO Add collapsed border painting for spanned cells
    [junit] 06.06.2005 15:12:39 org.apache.fop.layoutmgr.table.Cell addAreas
    [junit] WARNUNG: TODO Add collapsed border painting for spanned cells
    [junit] 06.06.2005 15:12:39 org.apache.fop.layoutmgr.table.TableContentLayoutManager createElementsForRowGroup
    [junit] WARNUNG: Contents of row 1 violate a maximum constraint in block-progression-dimension. Due to its contents the row grows to 35000 millipoints. The row constraint resolve to MinOptMax: min=20000; opt=20000; max=20000
    [junit] 06.06.2005 15:12:40 org.apache.fop.layoutmgr.table.TableContentLayoutManager createElementsForRowGroup
    [junit] WARNUNG: Contents of row 1 violate a maximum constraint in block-progression-dimension. Due to its contents the row grows to 40000 millipoints. The row constraint resolve to MinOptMax: min=20000; opt=20000; max=20000
    [junit] 06.06.2005 15:12:40 org.apache.fop.layoutmgr.table.TableContentLayoutManager createElementsForRowGroup
    [junit] WARNUNG: Contents of row 1 violate a maximum constraint in block-progression-dimension. Due to its contents the row grows to 40000 millipoints. The row constraint resolve to MinOptMax: min=20000; opt=20000; max=20000
    [junit] 06.06.2005 15:12:40 org.apache.fop.layoutmgr.table.TableContentLayoutManager createElementsForRowGroup
    [junit] WARNUNG: Contents of row 6 violate a maximum constraint in block-progression-dimension. Due to its contents the row grows to 24000 millipoints. The row constraint resolve to MinOptMax: min=0; opt=0; max=20000
    [junit] ------------- ---------------- ---------------
    [junit] Testcase: text-transform1.xml(org.apache.fop.layoutengine.LayoutEngineTestSuite$1): Caused an ERROR
    [junit] Expected XPath expression to evaluate to 'capitalize: This Text Is Capitalized.', but got 'capitalize: This TExt Is Capitalized.' (XPath: //flow/block[2])
    [junit] java.lang.RuntimeException: Expected XPath expression to evaluate to 'capitalize: This Text Is Capitalized.', but got 'capitalize: This TExt Is Capitalized.' (XPath: //flow/block[2])
    [junit] at org.apache.fop.layoutengine.EvalCheck.check(EvalCheck.java:64)
    [junit] at org.apache.fop.layoutengine.LayoutEngineTester.checkAll(LayoutEngineTester.java:195)
    [junit] at org.apache.fop.layoutengine.LayoutEngineTester.runTest(LayoutEngineTester.java:145)
    [junit] at org.apache.fop.layoutengine.LayoutEngineTestSuite$LayoutEngineTestCase.testMain(LayoutEngineTestSuite.java:132)
    [junit] at org.apache.fop.layoutengine.LayoutEngineTestSuite$1.runTest(LayoutEngineTestSuite.java:111)
BUILD FAILED: C:\Programme\eclipse-SDK-3.0.2\eclipse\workspace\apache fop\build.xml:754: Test org.apache.fop.layoutengine.LayoutEngineTestSuite failed

> -----Original Message-----
> From: Jeremias Maerki [mailto:[hidden email]]
> Sent: Monday, June 06, 2005 3:02 PM
> To: [hidden email]
> Subject: Re: [Tests] automated Tests for FOP's XSL-Standard compilance
>
>
> Yes, there are a few footnote tests that currently don't work. The
> text-transform tests should work, though. What were the error messages
> for text-transform? CVS HEAD is still a moving target and the
> file with
> the disabled test cases may not always be up to date. But as it seems
> you're of the flexible kind which is good. :-)
>
> On 06.06.2005 14:13:23 Matthias Wessendorf wrote:
> > Hi Jeremias,
> >
> > I just looked at exsisting base of test cases. I had to disable some
> > footnotes xml. And also text-transform1|2 . xml
> >
> > After the the unit test for layout engine works fine for me
> (BUILD SUCCESSFUL)
> >
> > Is that a known issue?
>
>
>
> Jeremias Maerki
>
>
Reply | Threaded
Open this post in threaded view
|

RE: [Tests] automated Tests for FOP's XSL-Standard compilance

Matthias Wessendorf
In reply to this post by Matthias Wessendorf
> I don't intend to. It would send the wrong signal. I've
> already renamed
> the API to avoid "FOP" in the name, so I don't scare potential
> commercial implementors away. It's probably going to end up
> on java.net.
> But it's Apache v2 licensed, just like FOP. The intention is
> to have as
> many implementations as possible to make it easier to switch between
> different XSL-FO implementations without modifying too much
> in Java code.


ok I see, sounds interessting, I'll *observer* that stuff, but currently
I need something different ;)

> > do you know more details regarding the implementation of
> this feature?
>
> Depends on what you want to know. I can surely give pointers
> to someone
> who would like to try implementing it. But I haven't invested too much
> thought into how this would be done.


Ah, I thought there is still something regarding table-layout="auto" inside of CVS.

-Matthias

> > Thanks for your informations,
> > Matthias
> >
> > > be me since
> > > I'm into strict XSL-FO business document where this was never
> > > an issue,
> > > yet.
> > >
> > > I hope the above helps.
> > >
> > > Jeremias Maerki
> > >
> > >
>
>
>
> Jeremias Maerki
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Tests] automated Tests for FOP's XSL-Standard compilance

Jeremias Maerki
In reply to this post by Matthias Wessendorf
Are you really sure you got the latest sources? I've just updated
everything and don't see the problem. At first, I thought it would be a
problem with the Xalan version because the XPath statements might not
have been resolved correctly, but obviously text-transform doesn't even
have an effect on your side. Strange.

On 06.06.2005 15:12:57 Matthias Wessendorf wrote:
> :)
>
> here are all messages, I got (only on junit target (which are the interesting one))
>
> HTH,
> Matthias
>

<snip/>

>     [junit] Testcase: text-transform1.xml(org.apache.fop.layoutengine.LayoutEngineTestSuite$1): Caused an ERROR
>     [junit] Expected XPath expression to evaluate to 'capitalize: This Text Is Capitalized.', but got 'capitalize: This TExt Is Capitalized.' (XPath: //flow/block[2])
>     [junit] java.lang.RuntimeException: Expected XPath expression to evaluate to 'capitalize: This Text Is Capitalized.', but got 'capitalize: This TExt Is Capitalized.' (XPath: //flow/block[2])
>     [junit] at org.apache.fop.layoutengine.EvalCheck.check(EvalCheck.java:64)
>     [junit] at org.apache.fop.layoutengine.LayoutEngineTester.checkAll(LayoutEngineTester.java:195)
>     [junit] at org.apache.fop.layoutengine.LayoutEngineTester.runTest(LayoutEngineTester.java:145)
>     [junit] at org.apache.fop.layoutengine.LayoutEngineTestSuite$LayoutEngineTestCase.testMain(LayoutEngineTestSuite.java:132)
>     [junit] at org.apache.fop.layoutengine.LayoutEngineTestSuite$1.runTest(LayoutEngineTestSuite.java:111)
> BUILD FAILED: C:\Programme\eclipse-SDK-3.0.2\eclipse\workspace\apache fop\build.xml:754: Test org.apache.fop.layoutengine.LayoutEngineTestSuite failed

<snip/>


Jeremias Maerki

Reply | Threaded
Open this post in threaded view
|

RE: [Tests] automated Tests for FOP's XSL-Standard compilance

Matthias Wessendorf
In reply to this post by Matthias Wessendorf
I loaded FOP stuff via CVS this morning.



> -----Original Message-----
> From: Jeremias Maerki [mailto:[hidden email]]
> Sent: Monday, June 06, 2005 3:21 PM
> To: [hidden email]
> Subject: Re: [Tests] automated Tests for FOP's XSL-Standard compilance
>
>
> Are you really sure you got the latest sources? I've just updated
> everything and don't see the problem. At first, I thought it
> would be a
> problem with the Xalan version because the XPath statements might not
> have been resolved correctly, but obviously text-transform
> doesn't even
> have an effect on your side. Strange.
>
> On 06.06.2005 15:12:57 Matthias Wessendorf wrote:
> > :)
> >
> > here are all messages, I got (only on junit target (which
> are the interesting one))
> >
> > HTH,
> > Matthias
> >
>
> <snip/>
>
> >     [junit] Testcase:
> text-transform1.xml(org.apache.fop.layoutengine.LayoutEngineTe
> stSuite$1): Caused an ERROR
> >     [junit] Expected XPath expression to evaluate to
> 'capitalize: This Text Is Capitalized.', but got 'capitalize:
> This TExt Is Capitalized.' (XPath: //flow/block[2])
> >     [junit] java.lang.RuntimeException: Expected XPath
> expression to evaluate to 'capitalize: This Text Is
> Capitalized.', but got 'capitalize: This TExt Is
> Capitalized.' (XPath: //flow/block[2])
> >     [junit] at
> org.apache.fop.layoutengine.EvalCheck.check(EvalCheck.java:64)
> >     [junit] at
> org.apache.fop.layoutengine.LayoutEngineTester.checkAll(Layout
> EngineTester.java:195)
> >     [junit] at
> org.apache.fop.layoutengine.LayoutEngineTester.runTest(LayoutE
> ngineTester.java:145)
> >     [junit] at
> org.apache.fop.layoutengine.LayoutEngineTestSuite$LayoutEngine
> TestCase.testMain(LayoutEngineTestSuite.java:132)
> >     [junit] at
> org.apache.fop.layoutengine.LayoutEngineTestSuite$1.runTest(La
> youtEngineTestSuite.java:111)
> > BUILD FAILED:
> C:\Programme\eclipse-SDK-3.0.2\eclipse\workspace\apache
> fop\build.xml:754: Test
> org.apache.fop.layoutengine.LayoutEngineTestSuite failed
>
> <snip/>
>
>
> Jeremias Maerki
>
>
Reply | Threaded
Open this post in threaded view
|

RE: [Tests] automated Tests for FOP's XSL-Standard compilance

Hock Szabolcs
In reply to this post by Matthias Wessendorf
Hi!

I have the same problem  with text-transform1.xml and
text-transform2.xml.
The SAXParser splits the text into two parts and the FOText converts the
second part's first character to uppercase.
It is possible because the SAX specification allows it.
"Note too that there is no promise that the output will be sent as a
single call. As is always true in SAX, one logical string may be split
 across multiple blocks of memory and hence delivered as several
successive events."

the generated xml fragment for text-transform1.xml
<block bap="0 0 0 0" bpd="14400" bpda="14400" ipd="360000"
ipda="360000">
        <lineArea bap="0 0 0 0" bpd="14400" bpda="14400" ipd="0">
                <text color="#000000" font-family="F1" font-size="12000"
vpos="10266">capitalize: </text>
                <text color="#000000" font-family="F1" font-size="12000"
vpos="10266">This T</text>
                <text color="#000000" font-family="F1" font-size="12000"
vpos="10266">Ext Is Capitalized.</text>
        </lineArea>
</block>

I managed to solve this problem by concatenating these parts and convert
them when addChildNode or endOfNode call occur.
The tests now passed, the generated xml:
<block bap="0 0 0 0" bpd="14400" bpda="14400" ipd="360000"
ipda="360000">
        <lineArea bap="0 0 0 0" bpd="14400" bpda="14400" ipd="0">
                <text color="#000000" font-family="F1" font-size="12000"
vpos="10266">capitalize: </text>
                <text color="#000000" font-family="F1" font-size="12000"
vpos="10266">This Text Is Capitalized.</text>
        </lineArea>
</block>


diff:
Index: src/java/org/apache/fop/fo/FOText.java
===================================================================
RCS file:
/home/cvspublic/xml-fop/src/java/org/apache/fop/fo/FOText.java,v
retrieving revision 1.39
diff -r1.39 FOText.java
31a32
> import org.xml.sax.Locator;
98c99
<     public FOText(char[] chars, int start, int end, FONode parent) {
---
>     public FOText(FONode parent) {
100,103c101,118
<         endIndex = end - start;
<         this.ca = new char[endIndex];
<         System.arraycopy(chars, start, ca, 0, endIndex);
< //      System.out.println("->" + new String(ca) + "<-");
---

>     }
>
>     protected void addCharacters(char[] data, int start, int end,
>             PropertyList list, Locator locator) throws FOPException {
>
>         int length=end - start;
>         int calength=0;
>         char[] nca = null;
>         if (ca!=null) {
>             calength=ca.length;
>             nca = new char[calength+length];
>             System.arraycopy(ca,0, nca, 0, calength);
>         } else {
>             nca = new char[length];
>         }
>         System.arraycopy(data, start, nca, calength, length);
>         endIndex = nca.length;
>         this.ca = nca;
123c138
<     protected void startOfNode() {
---
>     protected void endOfNode() throws FOPException {
Index: src/java/org/apache/fop/fo/FObjMixed.java
===================================================================
RCS file:
/home/cvspublic/xml-fop/src/java/org/apache/fop/fo/FObjMixed.java,v
retrieving revision 1.47
diff -r1.47 FObjMixed.java
30a31,34
>
>
>     protected FOText ft = null;
>
51,54c55,60
<         FOText ft = new FOText(data, start, end, this);
<         ft.setLocator(locator);
<         ft.bind(pList);
<         ft.startOfNode();
---
>         if (ft==null) {
>             ft = new FOText(this);
>               ft.setLocator(locator);
>               ft.bind(pList);
>         }
>         ft.addCharacters(data, start, end, null,null);
56,57c62,84
<         getFOEventHandler().characters(ft.ca, ft.startIndex,
ft.endIndex);
<         addChildNode(ft);
---

>     }
>
>     protected void endOfNode() throws FOPException {
>         flushText();
>         super.endOfNode();
>     }
>
>     /**
>      * @throws FOPException
>      */
>     protected void flushText() throws FOPException {
>         if (ft!=null) {
>               FOText lft = ft;
>               ft=null;
>             lft.endOfNode();
>               getFOEventHandler().characters(lft.ca, lft.startIndex,
lft.endIndex);
>               addChildNode(lft);
>         }
>     }
>
>     protected void addChildNode(FONode child) throws FOPException {
>         flushText();
>         super.addChildNode(child);
Index: src/java/org/apache/fop/fo/flow/Block.java
===================================================================
RCS file:
/home/cvspublic/xml-fop/src/java/org/apache/fop/fo/flow/Block.java,v
retrieving revision 1.54
diff -r1.54 Block.java
176a177
>         super.endOfNode();
332a334
>         flushText();
Index: src/java/org/apache/fop/fo/flow/Inline.java
===================================================================
RCS file:
/home/cvspublic/xml-fop/src/java/org/apache/fop/fo/flow/Inline.java,v
retrieving revision 1.39
diff -r1.39 Inline.java
119a120
>         super.endOfNode();
Index: src/java/org/apache/fop/fo/flow/Marker.java
===================================================================
RCS file:
/home/cvspublic/xml-fop/src/java/org/apache/fop/fo/flow/Marker.java,v
retrieving revision 1.25
diff -r1.25 Marker.java
99c99,100
<     protected void endOfNode() {
---
>     protected void endOfNode() throws FOPException {
>         flushText();


Szabolcs


-----Original Message-----
From: Matthias Wessendorf [mailto:[hidden email]]
Sent: Monday, June 06, 2005 3:52 PM
To: [hidden email]
Subject: RE: [Tests] automated Tests for FOP's XSL-Standard compilance

I loaded FOP stuff via CVS this morning.



> -----Original Message-----
> From: Jeremias Maerki [mailto:[hidden email]]
> Sent: Monday, June 06, 2005 3:21 PM
> To: [hidden email]
> Subject: Re: [Tests] automated Tests for FOP's XSL-Standard compilance
>
>
> Are you really sure you got the latest sources? I've just updated
> everything and don't see the problem. At first, I thought it would be
> a problem with the Xalan version because the XPath statements might
> not have been resolved correctly, but obviously text-transform doesn't

> even have an effect on your side. Strange.
>
> On 06.06.2005 15:12:57 Matthias Wessendorf wrote:
> > :)
> >
> > here are all messages, I got (only on junit target (which
> are the interesting one))
> >
> > HTH,
> > Matthias
> >
>
> <snip/>
>
> >     [junit] Testcase:
> text-transform1.xml(org.apache.fop.layoutengine.LayoutEngineTe
> stSuite$1): Caused an ERROR
> >     [junit] Expected XPath expression to evaluate to
> 'capitalize: This Text Is Capitalized.', but got 'capitalize:
> This TExt Is Capitalized.' (XPath: //flow/block[2])
> >     [junit] java.lang.RuntimeException: Expected XPath
> expression to evaluate to 'capitalize: This Text Is Capitalized.', but

> got 'capitalize: This TExt Is Capitalized.' (XPath: //flow/block[2])
> >     [junit] at
> org.apache.fop.layoutengine.EvalCheck.check(EvalCheck.java:64)
> >     [junit] at
> org.apache.fop.layoutengine.LayoutEngineTester.checkAll(Layout
> EngineTester.java:195)
> >     [junit] at
> org.apache.fop.layoutengine.LayoutEngineTester.runTest(LayoutE
> ngineTester.java:145)
> >     [junit] at
> org.apache.fop.layoutengine.LayoutEngineTestSuite$LayoutEngine
> TestCase.testMain(LayoutEngineTestSuite.java:132)
> >     [junit] at
> org.apache.fop.layoutengine.LayoutEngineTestSuite$1.runTest(La
> youtEngineTestSuite.java:111)
> > BUILD FAILED:
> C:\Programme\eclipse-SDK-3.0.2\eclipse\workspace\apache
> fop\build.xml:754: Test
> org.apache.fop.layoutengine.LayoutEngineTestSuite failed
>
> <snip/>
>
>
> Jeremias Maerki
>
>

Reply | Threaded
Open this post in threaded view
|

Re: [Tests] automated Tests for FOP's XSL-Standard compilance

Jeremias Maerki
Thanks for looking into this. But would you mind creating the patch
again and this time in unified format (-u option)? Thank you!

On 07.06.2005 17:48:18 Hock Szabolcs wrote:

> Hi!
>
> I have the same problem  with text-transform1.xml and
> text-transform2.xml.
> The SAXParser splits the text into two parts and the FOText converts the
> second part's first character to uppercase.
> It is possible because the SAX specification allows it.
> "Note too that there is no promise that the output will be sent as a
> single call. As is always true in SAX, one logical string may be split
>  across multiple blocks of memory and hence delivered as several
> successive events."
>
> the generated xml fragment for text-transform1.xml
> <block bap="0 0 0 0" bpd="14400" bpda="14400" ipd="360000"
> ipda="360000">
> <lineArea bap="0 0 0 0" bpd="14400" bpda="14400" ipd="0">
> <text color="#000000" font-family="F1" font-size="12000"
> vpos="10266">capitalize: </text>
> <text color="#000000" font-family="F1" font-size="12000"
> vpos="10266">This T</text>
> <text color="#000000" font-family="F1" font-size="12000"
> vpos="10266">Ext Is Capitalized.</text>
> </lineArea>
> </block>
>
> I managed to solve this problem by concatenating these parts and convert
> them when addChildNode or endOfNode call occur.
> The tests now passed, the generated xml:
> <block bap="0 0 0 0" bpd="14400" bpda="14400" ipd="360000"
> ipda="360000">
> <lineArea bap="0 0 0 0" bpd="14400" bpda="14400" ipd="0">
> <text color="#000000" font-family="F1" font-size="12000"
> vpos="10266">capitalize: </text>
> <text color="#000000" font-family="F1" font-size="12000"
> vpos="10266">This Text Is Capitalized.</text>
> </lineArea>
> </block>
>
>
> diff:
> Index: src/java/org/apache/fop/fo/FOText.java
> ===================================================================
> RCS file:
> /home/cvspublic/xml-fop/src/java/org/apache/fop/fo/FOText.java,v
> retrieving revision 1.39
> diff -r1.39 FOText.java
> 31a32
> > import org.xml.sax.Locator;
> 98c99
> <     public FOText(char[] chars, int start, int end, FONode parent) {
> ---
> >     public FOText(FONode parent) {
> 100,103c101,118
> <         endIndex = end - start;
> <         this.ca = new char[endIndex];
> <         System.arraycopy(chars, start, ca, 0, endIndex);
> < //      System.out.println("->" + new String(ca) + "<-");
> ---
> >     }
> >
> >     protected void addCharacters(char[] data, int start, int end,
> >             PropertyList list, Locator locator) throws FOPException {
> >
> >         int length=end - start;
> >         int calength=0;
> >         char[] nca = null;
> >         if (ca!=null) {
> >             calength=ca.length;
> >             nca = new char[calength+length];
> >             System.arraycopy(ca,0, nca, 0, calength);
> >         } else {
> >             nca = new char[length];
> >         }
> >         System.arraycopy(data, start, nca, calength, length);
> >         endIndex = nca.length;
> >         this.ca = nca;
> 123c138
> <     protected void startOfNode() {
> ---
> >     protected void endOfNode() throws FOPException {
> Index: src/java/org/apache/fop/fo/FObjMixed.java
> ===================================================================
> RCS file:
> /home/cvspublic/xml-fop/src/java/org/apache/fop/fo/FObjMixed.java,v
> retrieving revision 1.47
> diff -r1.47 FObjMixed.java
> 30a31,34
> >
> >
> >     protected FOText ft = null;
> >
> 51,54c55,60
> <         FOText ft = new FOText(data, start, end, this);
> <         ft.setLocator(locator);
> <         ft.bind(pList);
> <         ft.startOfNode();
> ---
> >         if (ft==null) {
> >             ft = new FOText(this);
> >               ft.setLocator(locator);
> >               ft.bind(pList);
> >         }
> >         ft.addCharacters(data, start, end, null,null);
> 56,57c62,84
> <         getFOEventHandler().characters(ft.ca, ft.startIndex,
> ft.endIndex);
> <         addChildNode(ft);
> ---
> >     }
> >
> >     protected void endOfNode() throws FOPException {
> >         flushText();
> >         super.endOfNode();
> >     }
> >
> >     /**
> >      * @throws FOPException
> >      */
> >     protected void flushText() throws FOPException {
> >         if (ft!=null) {
> >               FOText lft = ft;
> >               ft=null;
> >             lft.endOfNode();
> >               getFOEventHandler().characters(lft.ca, lft.startIndex,
> lft.endIndex);
> >               addChildNode(lft);
> >         }
> >     }
> >
> >     protected void addChildNode(FONode child) throws FOPException {
> >         flushText();
> >         super.addChildNode(child);
> Index: src/java/org/apache/fop/fo/flow/Block.java
> ===================================================================
> RCS file:
> /home/cvspublic/xml-fop/src/java/org/apache/fop/fo/flow/Block.java,v
> retrieving revision 1.54
> diff -r1.54 Block.java
> 176a177
> >         super.endOfNode();
> 332a334
> >         flushText();
> Index: src/java/org/apache/fop/fo/flow/Inline.java
> ===================================================================
> RCS file:
> /home/cvspublic/xml-fop/src/java/org/apache/fop/fo/flow/Inline.java,v
> retrieving revision 1.39
> diff -r1.39 Inline.java
> 119a120
> >         super.endOfNode();
> Index: src/java/org/apache/fop/fo/flow/Marker.java
> ===================================================================
> RCS file:
> /home/cvspublic/xml-fop/src/java/org/apache/fop/fo/flow/Marker.java,v
> retrieving revision 1.25
> diff -r1.25 Marker.java
> 99c99,100
> <     protected void endOfNode() {
> ---
> >     protected void endOfNode() throws FOPException {
> >         flushText();
>
>
> Szabolcs
>
>
> -----Original Message-----
> From: Matthias Wessendorf [mailto:[hidden email]]
> Sent: Monday, June 06, 2005 3:52 PM
> To: [hidden email]
> Subject: RE: [Tests] automated Tests for FOP's XSL-Standard compilance
>
> I loaded FOP stuff via CVS this morning.
>
>
>
> > -----Original Message-----
> > From: Jeremias Maerki [mailto:[hidden email]]
> > Sent: Monday, June 06, 2005 3:21 PM
> > To: [hidden email]
> > Subject: Re: [Tests] automated Tests for FOP's XSL-Standard compilance
> >
> >
> > Are you really sure you got the latest sources? I've just updated
> > everything and don't see the problem. At first, I thought it would be
> > a problem with the Xalan version because the XPath statements might
> > not have been resolved correctly, but obviously text-transform doesn't
>
> > even have an effect on your side. Strange.
> >
> > On 06.06.2005 15:12:57 Matthias Wessendorf wrote:
> > > :)
> > >
> > > here are all messages, I got (only on junit target (which
> > are the interesting one))
> > >
> > > HTH,
> > > Matthias
> > >
> >
> > <snip/>
> >
> > >     [junit] Testcase:
> > text-transform1.xml(org.apache.fop.layoutengine.LayoutEngineTe
> > stSuite$1): Caused an ERROR
> > >     [junit] Expected XPath expression to evaluate to
> > 'capitalize: This Text Is Capitalized.', but got 'capitalize:
> > This TExt Is Capitalized.' (XPath: //flow/block[2])
> > >     [junit] java.lang.RuntimeException: Expected XPath
> > expression to evaluate to 'capitalize: This Text Is Capitalized.', but
>
> > got 'capitalize: This TExt Is Capitalized.' (XPath: //flow/block[2])
> > >     [junit] at
> > org.apache.fop.layoutengine.EvalCheck.check(EvalCheck.java:64)
> > >     [junit] at
> > org.apache.fop.layoutengine.LayoutEngineTester.checkAll(Layout
> > EngineTester.java:195)
> > >     [junit] at
> > org.apache.fop.layoutengine.LayoutEngineTester.runTest(LayoutE
> > ngineTester.java:145)
> > >     [junit] at
> > org.apache.fop.layoutengine.LayoutEngineTestSuite$LayoutEngine
> > TestCase.testMain(LayoutEngineTestSuite.java:132)
> > >     [junit] at
> > org.apache.fop.layoutengine.LayoutEngineTestSuite$1.runTest(La
> > youtEngineTestSuite.java:111)
> > > BUILD FAILED:
> > C:\Programme\eclipse-SDK-3.0.2\eclipse\workspace\apache
> > fop\build.xml:754: Test
> > org.apache.fop.layoutengine.LayoutEngineTestSuite failed
> >
> > <snip/>
> >
> >
> > Jeremias Maerki
> >
> >



Jeremias Maerki

Reply | Threaded
Open this post in threaded view
|

Re: [Tests] automated Tests for FOP's XSL-Standard compilance

Jeremias Maerki
In reply to this post by Hock Szabolcs
Thank you very much! I've just applied the updated patch you sent me
off-list. I had some problems applying it since some of the lines were
broken. It would be best to attach the patch as a file next time.

On 07.06.2005 17:48:18 Hock Szabolcs wrote:

> Hi!
>
> I have the same problem  with text-transform1.xml and
> text-transform2.xml.
> The SAXParser splits the text into two parts and the FOText converts the
> second part's first character to uppercase.
> It is possible because the SAX specification allows it.
> "Note too that there is no promise that the output will be sent as a
> single call. As is always true in SAX, one logical string may be split
>  across multiple blocks of memory and hence delivered as several
> successive events."
>
> the generated xml fragment for text-transform1.xml
> <block bap="0 0 0 0" bpd="14400" bpda="14400" ipd="360000"
> ipda="360000">
> <lineArea bap="0 0 0 0" bpd="14400" bpda="14400" ipd="0">
> <text color="#000000" font-family="F1" font-size="12000"
> vpos="10266">capitalize: </text>
> <text color="#000000" font-family="F1" font-size="12000"
> vpos="10266">This T</text>
> <text color="#000000" font-family="F1" font-size="12000"
> vpos="10266">Ext Is Capitalized.</text>
> </lineArea>
> </block>
>
> I managed to solve this problem by concatenating these parts and convert
> them when addChildNode or endOfNode call occur.
> The tests now passed, the generated xml:
> <block bap="0 0 0 0" bpd="14400" bpda="14400" ipd="360000"
> ipda="360000">
> <lineArea bap="0 0 0 0" bpd="14400" bpda="14400" ipd="0">
> <text color="#000000" font-family="F1" font-size="12000"
> vpos="10266">capitalize: </text>
> <text color="#000000" font-family="F1" font-size="12000"
> vpos="10266">This Text Is Capitalized.</text>
> </lineArea>
> </block>



Jeremias Maerki