You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by FB...@wiley.com on 2008/02/15 16:51:39 UTC

Breaking table rows with colored cells

Hi!

I have an application with really tall table cells -- so tall that they 
have to be able to break across pages. Some of the cells also need to have 
colored backgrounds.

Is it possible to do this using fop? I've done it in TeX before, but I 
don't really want to have to handle the color continuations in the output 
routine, since the PostScript and TeX code is likely to be extremely 
complex ....

Thanks!
Fred
Frederick H. Bartlett
Lead Systems Developer / Content Technology
John Wiley & Sons, Inc.

Resolved that situation RE: What could be the cause of SAXException like this: Mismatch: page-number (http://www.w3.org/1999/XSL/Format) vs. page-number ()?

Posted by Andrejus Chaliapinas <a....@infosana.com>.
> Hi
> 
> > My XSL has entries like these:
> >
> > <xsl:copy-of
> > select="xalan:nodeset(ext:generateSubtree())" />
> >
> > Where generateSubtree() is external Java class method and returns
> > result in
> > form of org.w3c.dom.NodeList and inside that nodes list I have
> > nodes like
> > <fo:page-number/> and whole XSL has such attribute specified:
> >
> > xmlns:fo="http://www.w3.org/1999/XSL/Format"
> >
> > Now when I run whole transformation process - I get:
> >
> > org.xml.sax.SAXException: Mismatch: page-number
> > (http://www.w3.org/1999/XSL/Format) vs. page-number ()
> 
> This is weird... So, if I interpret correctly, the input
> 
> <fo:page-number />
> 
> leads to a SAX startElement() event *with* the proper namespace, but
> somewhere in between (by Xalan, I presume) the namespace dissolves so
> that null is passed to the endElement() event...
>

It turned out that if during NodeList (which will be retuned then to
xalan:nodelist()) creation inside my Java code I use just this call:

Element elem = xmlDoc.createElement("fo:something");

then later I get that SAXException, but if I use this call:

Element elem = xmlDoc.createElementNS("http://www.w3.org/1999/XSL/Format",
"fo:something");

then everything works correctly.

My initial thought was that "fo:" namespace defined on the top of xsl will
be automatically propagated (I use factory.setNamespaceAware(true) as well)
into tree fragment creation, but seems not by some reason.

Anyway, now I have that part working.

Thank you for your suggestions.

Andrejus


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: What could be the cause of SAXException like this: Mismatch: page-number (http://www.w3.org/1999/XSL/Format) vs. page-number ()?

Posted by Andreas Delmelle <an...@telenet.be>.
On Feb 15, 2008, at 22:03, Andrejus Chaliapinas wrote:

Hi

> My XSL has entries like these:
>
> <xsl:copy-of
> select="xalan:nodeset(ext:generateSubtree())" />
>
> Where generateSubtree() is external Java class method and returns  
> result in
> form of org.w3c.dom.NodeList and inside that nodes list I have  
> nodes like
> <fo:page-number/> and whole XSL has such attribute specified:
>
> xmlns:fo="http://www.w3.org/1999/XSL/Format"
>
> Now when I run whole transformation process - I get:
>
> org.xml.sax.SAXException: Mismatch: page-number
> (http://www.w3.org/1999/XSL/Format) vs. page-number ()

This is weird... So, if I interpret correctly, the input

<fo:page-number />

leads to a SAX startElement() event *with* the proper namespace, but  
somewhere in between (by Xalan, I presume) the namespace dissolves so  
that null is passed to the endElement() event...

> <snip />
> So, which part cannot determine that proper namespace? Is it Xalan not
> populating result tree fragment with correct namespaces? Anything  
> to check
> (version, nodes list, etc).
>
> Also, I think I had this working before in different environment,  
> but not
> sure what has changed since that.

Be sure to check very thoroughly which version of Xalan is being  
used, and try to play with different versions.


Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: Any changes in regards to svg tags handling between Batik 1.6 and Batik 1.7?

Posted by Andrejus Chaliapinas <a....@infosana.com>.
> Correct. The interface has been moved out of Batik to the xml-apis-
> ext.jar, if I'm right...
>

Yes, that was the missing piece with latest batik. Thanks a lot!

Andrejus


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Any changes in regards to svg tags handling between Batik 1.6 and Batik 1.7?

Posted by Andreas Delmelle <an...@telenet.be>.
On Mar 10, 2008, at 16:11, Andrejus Chaliapinas wrote:

Hi

> If I use batik-all-1.6.jar under JDK 1.4/1.5 - I could normally  
> handle svg
> tags, but if I use batik-all-1.7.jar instead - I get this exception:
>
> java.lang.NoClassDefFoundError: org/w3c/dom/svg/SVGDocument
> <snip />
> Any place to look at/change? While I could see that
> org/w3c/dom/svg/SVGDocument class inside batik-all-1.6.jar, I don't  
> see it
> inside batik-all-1.7.jar

Correct. The interface has been moved out of Batik to the xml-apis- 
ext.jar, if I'm right...


Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Any changes in regards to svg tags handling between Batik 1.6 and Batik 1.7?

Posted by Chris Bowditch <bo...@hotmail.com>.
Andrejus Chaliapinas wrote:

> Hi,
> 
> If I use batik-all-1.6.jar under JDK 1.4/1.5 - I could normally handle svg
> tags, but if I use batik-all-1.7.jar instead - I get this exception:

What version of FOP are you using? Each release of FOP is tied to a 
specific release of Batik. FOP ships with the version of Batik which it 
is tied to. So you must use the version of batik that is shipped in 
fop\lib directory in order to render SVG within FOP correctly.

<snip/>

Chris



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Any changes in regards to svg tags handling between Batik 1.6 and Batik 1.7?

Posted by Andrejus Chaliapinas <a....@infosana.com>.
Hi,

If I use batik-all-1.6.jar under JDK 1.4/1.5 - I could normally handle svg
tags, but if I use batik-all-1.7.jar instead - I get this exception:

java.lang.NoClassDefFoundError: org/w3c/dom/svg/SVGDocument
	at java.lang.ClassLoader.defineClass0(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:808)
	at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:147)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:475)
	at java.net.URLClassLoader.access$500(URLClassLoader.java:109)
	at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:848)
	at java.security.AccessController.doPrivileged1(Native Method)
	at
java.security.AccessController.doPrivileged(AccessController.java:389)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:371)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:570)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:442)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:502)
	at
org.apache.batik.dom.svg.SVGDOMImplementation.createDocument(Unknown Source)
	at
org.apache.fop.fo.extensions.svg.SVGElement.init(SVGElement.java:176)
	at
org.apache.fop.fo.extensions.svg.SVGElement.processNode(SVGElement.java:78)
	at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.jav
a:320)
	at
org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:188)
	at
org.apache.xml.serializer.ToXMLSAXHandler.closeStartTag(ToXMLSAXHandler.java
:205)
	at
org.apache.xml.serializer.ToSAXHandler.flushPending(ToSAXHandler.java:276)
	at
org.apache.xml.serializer.ToXMLSAXHandler.startPrefixMapping(ToXMLSAXHandler
.java:349)
	at
org.apache.xml.serializer.ToXMLSAXHandler.startPrefixMapping(ToXMLSAXHandler
.java:319)
	at
org.apache.xml.dtm.ref.DTMTreeWalker.startNode(DTMTreeWalker.java:251)
	at
org.apache.xml.dtm.ref.DTMTreeWalker.traverse(DTMTreeWalker.java:112)
	at
org.apache.xml.dtm.ref.sax2dtm.SAX2DTM.dispatchToEvents(SAX2DTM.java:753)
	at
org.apache.xalan.serialize.SerializerUtils.outputResultTreeFragment(Serializ
erUtils.java:137)
	at
org.apache.xalan.templates.ElemCopyOf.execute(ElemCopyOf.java:190)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2374)
	at
org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:126)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2374)
	at
org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:392)
	at
org.apache.xalan.templates.ElemCallTemplate.execute(ElemCallTemplate.java:24
6)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2374)
	at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
681)
	at
org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.ja
va:431)
	at
org.apache.xalan.templates.ElemForEach.execute(ElemForEach.java:271)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2374)
	at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
681)
	at
org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.ja
va:431)
	at
org.apache.xalan.templates.ElemForEach.execute(ElemForEach.java:271)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2374)
	at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
681)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2374)
	at
org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:392)
	at
org.apache.xalan.templates.ElemCallTemplate.execute(ElemCallTemplate.java:24
6)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2374)
	at
org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:126)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2374)
	at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
681)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2374)
	at
org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:392)
	at
org.apache.xalan.templates.ElemCallTemplate.execute(ElemCallTemplate.java:24
6)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2374)
	at
org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:126)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2374)
	at
org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:392)
	at
org.apache.xalan.templates.ElemCallTemplate.execute(ElemCallTemplate.java:24
6)
	at
org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.ja
va:431)
	at
org.apache.xalan.templates.ElemForEach.execute(ElemForEach.java:271)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2374)
	at
org.apache.xalan.templates.ElemTemplate.execute(ElemTemplate.java:392)
	at
org.apache.xalan.templates.ElemCallTemplate.execute(ElemCallTemplate.java:24
6)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2374)
	at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
681)
	at
org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.ja
va:431)
	at
org.apache.xalan.templates.ElemForEach.execute(ElemForEach.java:271)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2374)
	at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
681)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2374)
	at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
681)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2374)
	at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
681)
	at
org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApp
lyTemplates.java:393)
	at
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.jav
a:176)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2374)
	at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transformer
Impl.java:2245)
	at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
ava:1334)
	at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
738)
	at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
1251)
	at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
1229)

Any place to look at/change? While I could see that
org/w3c/dom/svg/SVGDocument class inside batik-all-1.6.jar, I don't see it
inside batik-all-1.7.jar

Thank you,
Andrejus


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: What could be the cause of SAXException like this: Mismatch: page-number (http://www.w3.org/1999/XSL/Format) vs. page-number ()?

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Andrejus Chaliapinas wrote:
> My XSL has entries like these:
>
> <xsl:copy-of
> select="xalan:nodeset(ext:generateSubtree())" />
>
> Where generateSubtree() is external Java class method and returns result in
> form of org.w3c.dom.NodeList and inside that nodes list I have nodes like
> <fo:page-number/>  and whole XSL has such attribute specified:
>
> xmlns:fo="http://www.w3.org/1999/XSL/Format"
>
> Now when I run whole transformation process - I get:
>
> org.xml.sax.SAXException: Mismatch: page-number
> (http://www.w3.org/1999/XSL/Format) vs. page-number ()

It looks like Xalan passes an empty string to the endElement method,
while the startElement looked correct. The most likely reason is that
the namespace settings on your DOM tree are messed up, possibly during
processing.
It is also quite possible that you have hit a bug in Xalan. Try to find
out which Xalan version you are actually using (e.g. by using
system-property(xsl:vendor)), you might have to tell your JRE to use a 
newer one.
If you serialize the result of the transformation rather then feeding
it into FOP, do you also see a wrong end tag? (you might have to insert
a text node into the fo:page number element to see an effect)
In either case you can probably gather more useful information on the
Xalan user list.

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


What could be the cause of SAXException like this: Mismatch: page-number (http://www.w3.org/1999/XSL/Format) vs. page-number ()?

Posted by Andrejus Chaliapinas <a....@infosana.com>.
Hi,

My XSL has entries like these:

<xsl:copy-of
select="xalan:nodeset(ext:generateSubtree())" />

Where generateSubtree() is external Java class method and returns result in
form of org.w3c.dom.NodeList and inside that nodes list I have nodes like
<fo:page-number/> and whole XSL has such attribute specified:

xmlns:fo="http://www.w3.org/1999/XSL/Format"

Now when I run whole transformation process - I get:

org.xml.sax.SAXException: Mismatch: page-number
(http://www.w3.org/1999/XSL/Format) vs. page-number ()
	at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:
369)
	at
org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:196)
	at
org.apache.xml.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:26
1)
	at
org.apache.xml.dtm.ref.DTMTreeWalker.endNode(DTMTreeWalker.java:373)
	at
org.apache.xalan.transformer.TreeWalker2Result.endNode(TreeWalker2Result.jav
a:85)
	at
org.apache.xml.dtm.ref.DTMTreeWalker.traverse(DTMTreeWalker.java:116)
	at
org.apache.xalan.transformer.TreeWalker2Result.traverse(TreeWalker2Result.ja
va:72)
	at
org.apache.xalan.templates.ElemCopyOf.execute(ElemCopyOf.java:184)
	... 52 more

So, which part cannot determine that proper namespace? Is it Xalan not
populating result tree fragment with correct namespaces? Anything to check
(version, nodes list, etc).

Also, I think I had this working before in different environment, but not
sure what has changed since that.

Thank you,
Andrejus


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Breaking table rows with colored cells

Posted by Andreas Delmelle <an...@telenet.be>.
On Feb 15, 2008, at 16:51, FBartlet@wiley.com wrote:

Hi,

> I have an application with really tall table cells -- so tall that  
> they have to be able to break across pages. Some of the cells also  
> need to have colored backgrounds.
>
> Is it possible to do this using fop?

How do you mean precisely?
The default behavior is that the background-color specified on the  
table-cell will be automatically used on each page it spans. Is that  
what you're looking for?


Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org