After giving a better look, I could have found where the problem is:
look at the begin of visitElements routine (line 101):
if( xElem->hasAttributes() )
rFunc(xElem,xElem->getAttributes());
else
rFunc(xElem);
The function called in case the element has at least one
attribute or no atribute at all are different.
In the first case ShapeWritingVisitor method:
void operator()( const uno::Reference<xml::dom::XElement>& xElem,
const uno::Reference<xml::dom::XNamedNodeMap>&
xAttributes );
is called
in the second case the method invoked is:
void operator()( const uno::Reference<xml::dom::XElement>& )
that has an empty body (line 1204), so when your example is processed
nothing happens.
The rationale should be that an element without any attribute does
not bring any info to parse. But for a <text> or <tspan> element is
different because of the characters included between the start and
the end tag.
-- Marco
On Wed, 25 Apr 2012 13:03:08 +0200, Marco Cecchetti
<mrcekets@gmail.com> wrote:
That's odd, saxbuilder should be completely agnostic
from a element name point of view.
Did you try to print element names xElem->getNodeName() (line 1227)
for the broken example ?
-- Marco
On Wed, 25 Apr 2012 11:48:10 +0200, Noel Grandin
<noelgrandin@gmail.com> wrote:
Looks like the code in
unoxml/source/dom/saxbuilder.cxx
converts the SAX event stream into a DOM tree.
On 2012-04-25 08:34, Christina Rossmanith wrote:
for the example without "x" and "y" attribute the "case XML_TEXT"
block is never reached. That's why I'd like to understand where and
how the tree is built.
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.