Since the question might be insightful for many people, I
will answer publicly:
Actually, I don't use getElementsByTagName because it
returns arrays
of a single type of tags... which is not useful in parsing a
document.
What getElementsByTagName allows you to do is to retrieve
elements
when you know the structure of the document... but an office
document
doesn't have a static structure...
What I am currently doing if use a mix of hasChildNodes()
and
childNodes[] traversing. If an element has a .tagName that
is
undefined, then this is a textnode and I retrieve its
.nodeValue.
Otherwise, I can go deeper in the node. The next step is to
format
this on screen, while keeping a way to rebuild the tree
without too
much work...
On 3/21/06, kourge <kourge gmail.com> wrote:
> I have a question:
> How do you get tags that has a namespace?
> For example, I have an XML document with elements named
<s:slide>, but
> document.getElementsByTagName("s:slide")
doesn't seem to work.
>
> --kourge
>
> On 3/21/06, Jacques Mony <jacques.mony gmail.com> wrote:
> > Hi,
> >
> > I've been busy like hell lately, but made a few
tests with pure DOM
> > XML -Parsing and it seems to work properly. I
still need to find a way
> > to maintain an editable XML tree and I should
finally have a nice
> > prototype by the end of the month.
> >
> > --
> > Jacques Mony
> >
> >
> >
-------------------------------------------------------
> > This SF.Net email is sponsored by xPML, a
groundbreaking scripting language
> > that extends applications into web and mobile
media. Attend the live webcast
> > and join the prime developer group breaking into
this new coding territory!
> > http:/
/sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$17
20&dat1642
> > _______________________________________________
> > Ajaxoffice-devel mailing list
> > Ajaxoffice-devel lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/ajaxof
fice-devel
> >
>
--
Jacques Mony
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking
scripting language
that extends applications into web and mobile media. Attend
the live webcast
and join the prime developer group breaking into this new
coding territory!
http:
//sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$
1720&dat1642
_______________________________________________
Ajaxoffice-devel mailing list
Ajaxoffice-devel lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ajaxof
fice-devel
|