Namespaces for attributes in instream objects
Dear Fop-Devs, I've just recently encountered a possible bug in the jeuclid plugin for fop. A complete .fo file is added at the end of the mail. In this file there is a foreign math object: fo:instream-foreign-object mml:math mml:mstyle mathsize=6pt mml:mix/mml:mi /mml:mstyle /mml:math /fo:instream-foreign-object, which, as you can see, uses the mathsize attribute. HOWEVER, the attribute gets ignored, because it is in the default namespace, and only the attributes in the mml namespace are actually processed by the plugin. So the above needed to be fixed to: mml:mstyle mml:mathsize=6pt mml:mix/mml:mi /mml:mstyle to work properly. So here are my questions: - Is this indeed the expected behavior? It seems unintuitive. - If it is, should it be? Should the plugin not also process attributes from the default namespace? - If it is not, where do i need to start looking for the bug? Jeuclid completely ignores namespaces in attributes, so it is either in the fop/plugin interface, fop itself, or the xerces parser? Thanks Max --- ?xml version=1.0? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:mml=http://www.w3.org/1998/Math/MathML; font-size=10pt fo:layout-master-set fo:simple-page-master master-name=page fo:region-body region-name=flow/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=page fo:flow flow-name=flow fo:block Normal fo:instream-foreign-object mml:math mml:mix/mml:mi /mml:math /fo:instream-foreign-object, small fo:instream-foreign-object mml:math mml:mstyle mathsize=6pt mml:mix/mml:mi /mml:mstyle /mml:math /fo:instream-foreign-object, big fo:instream-foreign-object mml:math mml:mstyle mathsize=24pt mml:mix/mml:mi /mml:mstyle /mml:math /fo:instream-foreign-object /fo:block /fo:flow /fo:page-sequence /fo:root
Re: Namespaces for attributes in instream objects
I use attributes in the default namespace in Barcode4J and have no problems there. I've just updated my local JEuclid working copy and tried once again to build it or set it up in Eclipse but I failed. Once again. I have no nerves for Maven and won't waste one more second of my life on a Maven-enabled project that doesn't just build. Sorry, but I can't help if I can't debug locally. On 14.01.2008 14:23:59 Max Berger wrote: Dear Fop-Devs, I've just recently encountered a possible bug in the jeuclid plugin for fop. A complete .fo file is added at the end of the mail. In this file there is a foreign math object: fo:instream-foreign-object mml:math mml:mstyle mathsize=6pt mml:mix/mml:mi /mml:mstyle /mml:math /fo:instream-foreign-object, which, as you can see, uses the mathsize attribute. HOWEVER, the attribute gets ignored, because it is in the default namespace, and only the attributes in the mml namespace are actually processed by the plugin. So the above needed to be fixed to: mml:mstyle mml:mathsize=6pt mml:mix/mml:mi /mml:mstyle to work properly. So here are my questions: - Is this indeed the expected behavior? It seems unintuitive. - If it is, should it be? Should the plugin not also process attributes from the default namespace? - If it is not, where do i need to start looking for the bug? Jeuclid completely ignores namespaces in attributes, so it is either in the fop/plugin interface, fop itself, or the xerces parser? Thanks Max snip/ Jeremias Maerki
Re: Namespaces for attributes in instream objects
On Jan 14, 2008, at 14:23, Max Berger wrote: Hi Max, I've just recently encountered a possible bug in the jeuclid plugin for fop. Just checking (would make tracking it a bit easier): Do you have any idea if this ever worked, and if yes, when this stopped working? (or: Do you remember having used the MathML extension and not running into the issue?) Would be nice to know, but no matter if you don't have the answer. More inline below... A complete .fo file is added at the end of the mail. In this file there is a foreign math object: fo:instream-foreign-object mml:math mml:mstyle mathsize=6pt mml:mix/mml:mi /mml:mstyle /mml:math /fo:instream-foreign-object, which, as you can see, uses the mathsize attribute. HOWEVER, the attribute gets ignored, because it is in the default namespace, and only the attributes in the mml namespace are actually processed by the plugin. So the above needed to be fixed to: mml:mstyle mml:mathsize=6pt mml:mix/mml:mi /mml:mstyle to work properly. So here are my questions: - Is this indeed the expected behavior? It seems unintuitive. For FO, we assume all attributes in the default namespace to be XSL- FO properties, so I think this is unexpected... :/ - If it is, should it be? Should the plugin not also process attributes from the default namespace? I would definitely say so. - If it is not, where do i need to start looking for the bug? Jeuclid completely ignores namespaces in attributes, so it is either in the fop/plugin interface, fop itself, or the xerces parser? I can't quite put my finger on it yet, but if I were to start looking, I'd try placing a breakpoint in the private org.apache.fop.fo.XMLObj#setAttributes(). See what happens there. Judging from the code, the attributes without a prefix are added to the node via the generic org.w3c.dom.Element#setAttribute(). Maybe problems with the (writable) DOM implementation? Or does the MathML extension not use the 'XMLObj.element' member, or ? HTH! Andreas