[xmlc] Re: Accessing the body in a Document

"Jacob Kjome" <[email protected]> Mon, 14 Jun 2010 10:52:17 -0500
Newsgroups gmane.comp.java.enhydra.xmlc
Message-ID <[email protected]>
This is a multi-part message in MIME format...

------------=_1276534340-5928-1983
Content-Type: text/plain;charset=iso-8859-1;format="flowed"
Content-Transfer-Encoding: quoted-printable

Hi Franck,

That is strange.=A0 Do you experience the same issue when using the HTML =
DOM=20
rather than the XHTML DOM?=A0 What happens if you use the HTML DOM interf=
ace=20
method HTMLDocument.getBody()?=A0 How about getElementsByTagName("body") =
(try=20
with and without providing the XHTML namespace)?

Hmm... I just performed the following search...
http://www.google.com/search?q=3Dchild.getNextSibling%28%29+incorrectly+r=
eturns+null

...and the following results look a bit suspicious...

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=3D6333993
http://code.google.com/p/android/issues/detail?id=3D779

When you run your server, try placing xercesImpl-2.9.1.jar in the server'=
s=20
classpath and place the xml-apis.jar that ships with Xerces 2.9.1 in an=20
"endorsed" library directory.=A0 Do you get the same results?

Besides that, it could be related to a recently fixed bug in Xerces deali=
ng=20
with transferring deferred nodes when using adopNode() (or cloneNode(), w=
hich=20
might produce similar behavior and which XMLC does whenever it serves up =
a=20
copy of the DOM).=A0 You could try building from the latest Xerces source=
 or=20
just wait until 2.10.0 is released, which should be any time now accordin=
g to=20
reports on the Xerces user list.

https://issues.apache.org/jira/browse/XERCESJ-1450


Jake

On Mon, 14 Jun 2010 11:54:29 +0200
  Franck Routier <[email protected]> wrote:
> Hi,
>=20
> I am playing with components in Barracuda, that I'd like to render in
> the body tag of the document (these are script components, currently
> rendered in the head, but yslow and google speed suggest it might be
> better to render some of them at the end of the document).
>=20
> So, in my renderer, I access to the Document using the following code :
>=20
> Node node =3D view.getNode();
> Document doc =3D node.getOwnerDocument();
> Element elRoot =3D doc.getDocumentElement();
>=20
> So here, doc is an ....Impl generated by xmlc, and elRoot corresponds t=
o
> the htlm tag (in my example I have a XHTMLHtmlElement).
> Until now I'm fine.
>=20
> Node child =3D elRoot.getFirstChild();
>=20
> --> child is of type HTMLHeadElement. Ok.
>=20
> child =3D child.getNextSibling();
>=20
> --> child is null. Argh.
>=20
> Is there an explaination why my document does not give me access to the
> body Node ?
>=20
> Thanks in advance,
>=20
>Franck
>=20
>=20
>=20


------------=_1276534340-5928-1983
Content-Type: text/plain; charset="UTF-8"; name="message-footer.txt"
Content-Disposition: inline; filename="message-footer.txt"
Content-Transfer-Encoding: quoted-printable


--
You receive this message as a subscriber of the [email protected] mailing list=
.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=3Dhelp
OW2 mailing lists service home page: http://www.ow2.org/wws

------------=_1276534340-5928-1983--