Re: Problem with implementation of getChildNodes on HTMLFormElement?

Aaron Kardell <[email protected]> Sat, 13 Sep 2003 09:10:00 -0500
Newsgroups gmane.comp.java.enhydra.xmlc
Message-ID <[email protected]>
Thanks for you posts Petr and Jacob,

I searched Bugzilla to no avail regarding getChildNodes.  In fact, only three
entires were found in the entire 1.x branch of xerces.


---
Aaron Kardell
Development Manager & Chief Architect of SiPS
Altona Ed, LLC <http://www.altonaed.com/>
[email protected]

> Subject: Re: Xmlc:  Problem with implementation of getChildNodes on
> 	HTMLFormElement?
> From: Petr Stehlik <[email protected]>
> To: [email protected]
> Date: Fri, 12 Sep 2003 19:06:18 +0200
> Reply-To: [email protected]
> 
> V St, 10. 09. 2003 v 22:53, Jacob Kjome pí¹e:
> > Thanks for the testcase.  I have replicated the behavior but, like you, I'm
> 
> > not sure what exactly is causing it.  It should definitely be figured 
> > out.
> 
> I experienced something similar with a function that traverses the DOM 
> and returns all nodes that have class with a given name:
> 
> public static Vector getByClassName(Node node, String className) {
>   Vector elems = new Vector();
>   NodeList children = node.getChildNodes();
>   for (int i=0; i<children.getLength();i++) {
>     elems.addAll(getByClassName(children.item(i), className));
>   }
>   if (node instanceof HTMLElement) {
>     String elemClassName = ((HTMLElement)node).getClassName();
>     if ((elemClassName != null) && elemClassName.equalsIgnoreCase(className))
> {
>       elems.add((HTMLElement)node);
>     }
>   }
>   return elems;
> }
> 
> This works fine on several pages but I also have one page where this
> doesn't work - doesn't return any node eventhough there are several ones
> with the class set.
> 
> I never figured out why it doesn't work. I could probably create a
> testcase from the html page and share it as well.
> 
> Petr
> 
> P.S. Would be nice to fix this issue and release XMLC 2.2.1 that would
> be a drop-in replacement for the XMLC in (at that time probably
> released) Enhydra 5.1 :) Yes I really appreciate the new modular
> structure of Enhydra 5.1 :))
> 
> 
> 
> 
> --__--__--
> 
> Message: 7
> Date: Fri, 12 Sep 2003 14:03:03 -0500
> To: [email protected]
> From: Jacob Kjome <[email protected]>
> Subject: Re: Xmlc:  HMLObjectImpl#toDocument() issue
> Reply-To: [email protected]
> 
> Hi Petr,
> 
> At 06:48 PM 9/12/2003 +0200, you wrote:
> >V St, 10. 09. 2003 v 23:14, Jacob Kjome pí¹e:
> > > The HTMLObjectImple#toDocument() method is setting custom
> > > OutpuOptions.  Where I thought we had gotten rid of the issue with
> default
> > > removal of HTML Span id's.
> >
> > > I think it should do this...
> > >
> > >      public String toDocument() {
> > >          // Create formatter if needed (no synchronization necessary)
> > >          if (fFormatter == null) {
> > >              fFormatter = new
> > > DOMFormatter(DOMFormatter.getDefaultOutputOptions(getDocument()));
> > >          }
> > >          return fFormatter.toString(this);
> > >      }
> > >
> > > Thoughts?  Anyone opposed to this?
> >
> >Will this be included in Enhydra 5.1 final? Alfred? Please..
> >
> >Petr
> >
> >P.S. Wondering if setEnableXHTMLCompatibility() shouldn't be enabled in
> >Enhydra by default as well.
> 
> Note that normally one wouldn't use toDocument() anyway.  It really isn't 
> all that flexible.  You'd normally use something like XMLCContext or 
> DOMFormatter#write() where you can provide OutputOptions and set any quirks 
> you want.  I don't consider this a huge deal like the other issue with the 
> NodeList not being populated in some cases.  This issue alone wouldn't 
> constitute an XMLC-2.2.1 release, IMO.
> 
> Jake
> 
> 
> >_______________________________________________
> >XMLC mailing list
> >[email protected]
> >http://www.enhydra.org/mailman/listinfo.cgi/xmlc
> 
> 
> 
> --__--__--
> 
> Message: 8
> Date: Fri, 12 Sep 2003 14:11:05 -0500
> To: [email protected]
> From: Jacob Kjome <[email protected]>
> Subject: Re: Xmlc:  Problem with implementation of getChildNodes on
>   HTMLFormElement?
> Reply-To: [email protected]
> 
> Hi Petr,
> 
> At 07:06 PM 9/12/2003 +0200, you wrote:
> >V St, 10. 09. 2003 v 22:53, Jacob Kjome pí¹e:
> > > Thanks for the testcase.  I have replicated the behavior but, like you, 
> > I'm
> > > not sure what exactly is causing it.  It should definitely be figured
> > > out.
> >
> >I experienced something similar with a function that traverses the DOM
> >and returns all nodes that have class with a given name:
> >
> >public static Vector getByClassName(Node node, String className) {
> >   Vector elems = new Vector();
> >   NodeList children = node.getChildNodes();
> >   for (int i=0; i<children.getLength();i++) {
> >     elems.addAll(getByClassName(children.item(i), className));
> >   }
> >   if (node instanceof HTMLElement) {
> >     String elemClassName = ((HTMLElement)node).getClassName();
> >     if ((elemClassName != null) && 
> > elemClassName.equalsIgnoreCase(className)) {
> >       elems.add((HTMLElement)node);
> >     }
> >   }
> >   return elems;
> >}
> >
> >This works fine on several pages but I also have one page where this
> >doesn't work - doesn't return any node eventhough there are several ones
> >with the class set.
> >
> >I never figured out why it doesn't work. I could probably create a
> >testcase from the html page and share it as well.
> 
> Absolutely.  Any testcases that reproduce this issue are welcome.  Any idea 
> if the issue happened on a specific type of node?  Was it an 
> HTMLFormElement which is the issue with the current reported bug?
> 
> >Petr
> >
> >P.S. Would be nice to fix this issue and release XMLC 2.2.1 that would
> >be a drop-in replacement for the XMLC in (at that time probably
> >released) Enhydra 5.1 :) Yes I really appreciate the new modular
> >structure of Enhydra 5.1 :))
> 
> A bug fix for this would, IMO, constitute an XMLC-2.2.1 release.  Any help 
> in figuring it out is welcomed.
> 
> Jake
> 
> 
> 
> >_______________________________________________
> >XMLC mailing list
> >[email protected]
> >http://www.enhydra.org/mailman/listinfo.cgi/xmlc
> 
> 
> 
> --__--__--
> 
> Message: 9
> Date: Fri, 12 Sep 2003 14:19:08 -0500
> To: [email protected]
> From: Jacob Kjome <[email protected]>
> Subject: Re: Xmlc:  biting the tomcat bullet and xmlc
> Reply-To: [email protected]
> 
> At 09:01 AM 9/12/2003 -0600, you wrote:
> >Thanks David... It's fun diving back into xmlc... BTW, my kudos to whoever 
> >wrote the release notes @
> ./xmlc-2.2/release-notes/xmlc-2-2-release-note.html
> 
> I think we all had a hand in this.  I added many of the final details, 
> clarified a few things, and made it XHTML1.1 compliant before 
> release.  What, particularly, did you like about it?  Just curious.
> 
> >I'd like to see these posted as a easily accessible link on
> xmlc.enhydra.org.
> 
> I believe you have administrative rights to said site.  Can you go ahead 
> and put it up there?  Or did you mean for us to put it up on the objectweb 
> site and provide a publicly available link?
> 
> You can go ahead and use this link...
>
http://cvs.forge.objectweb.org/cgi-bin/cvsweb.cgi/~checkout~/xmlc/release/release-notes/xmlc-2-2-release-note.html?rev=1.3&content-type=text/html&cvsroot=xmlc
> 
> or, in a more friendly form...
> http://tinyurl.com/n626
> 
> later,
> 
> Jake
> 
> 
> >David
> >
> >
> >David Li wrote:
> >
> >>Hi David,
> >>   Check out the samples directory in the XMLC 2.2 distribution. The 
> >> sample is done with Tomcat + XMLC.
> >>David
> >>
> >>>Hi all,
> >>>I'm trying to figure out how to develop html pages in
> >>>an xmlc & tomcat environment.  Are there any suggested
> >>>tomcat file hierarchies for placing xmlc-ready html
> >>>files and the generated xmlc class files?
> >>>
> >>>With the enhydra tree, it was a cinch to use
> >>>Dreamweaver to evolve the html pages and just build
> >>>the app in place. It was all under
> >>>./presentation/resources.  With tomcat, I'm not sure
> >>>how to handle the relative URLs (e.g., how the html
> >>>page references gif images).    Do you use the
> >>>urlmapping option to rename the paths from where
> >>>dreamweaver believes the resources are to what tomcat
> >>>wants them?
> >>>
> >>>Hope my question makes some sense.  Would love your
> >>>suggestions.
> >>>
> >>>David
> >>
> >>_______________________________________________
> >>XMLC mailing list
> >>[email protected]
> >>http://www.enhydra.org/mailman/listinfo.cgi/xmlc
> >>.
> >
> >
> >--
> >David H. Young
> >SAMBA Holdings, Inc.
> >Chief Technology Officer
> >1730 Montaño NW
> >Albuquerque, NM 87107
> >505.797.2622 x113
> >http://www.samba.biz
> >
> >
> >_______________________________________________
> >XMLC mailing list
> >[email protected]
> >http://www.enhydra.org/mailman/listinfo.cgi/xmlc
> 
> 
> 
> --__--__--
> 
> Message: 10
> Date: Fri, 12 Sep 2003 16:16:04 -0600
> From: "David H. Young" <[email protected]>
> To: [email protected]
> Subject: Re: Xmlc:  biting the tomcat bullet and xmlc
> Reply-To: [email protected]
> 
> Hi Jacob...
> 
> simple, it's clean and concise about what's new...  I thought there was 
> one more point: xmlc is no longer dependent on an enhydra environment. 
> Was that an earlier version or this one?
> 
> It's been so long since I've updated enhydra pages @ enhydra.org I've 
> completely forgotten the process.  I've pinged Christophe for some 
> assistance.
> 
> David
> 
> Jacob Kjome wrote:
> 
> > At 09:01 AM 9/12/2003 -0600, you wrote:
> > 
> >> Thanks David... It's fun diving back into xmlc... BTW, my kudos to 
> >> whoever wrote the release notes @ 
> >> ./xmlc-2.2/release-notes/xmlc-2-2-release-note.html
> > 
> > 
> > I think we all had a hand in this.  I added many of the final details, 
> > clarified a few things, and made it XHTML1.1 compliant before release.  
> > What, particularly, did you like about it?  Just curious.
> > 
> >> I'd like to see these posted as a easily accessible link on 
> >> xmlc.enhydra.org.
> > 
> > 
> > I believe you have administrative rights to said site.  Can you go ahead 
> > and put it up there?  Or did you mean for us to put it up on the 
> > objectweb site and provide a publicly available link?
> > 
> > You can go ahead and use this link...
> >
>
http://cvs.forge.objectweb.org/cgi-bin/cvsweb.cgi/~checkout~/xmlc/release/release-notes/xmlc-2-2-release-note.html?rev=1.3&content-type=text/html&cvsroot=xmlc
> 
> > 
> > 
> > or, in a more friendly form...
> > http://tinyurl.com/n626
> > 
> > later,
> > 
> > Jake
> > 
> > 
> >> David
> >>
> >>
> >> David Li wrote:
> >>
> >>> Hi David,
> >>>   Check out the samples directory in the XMLC 2.2 distribution. The 
> >>> sample is done with Tomcat + XMLC.
> >>> David
> >>>
> >>>> Hi all,
> >>>> I'm trying to figure out how to develop html pages in
> >>>> an xmlc & tomcat environment.  Are there any suggested
> >>>> tomcat file hierarchies for placing xmlc-ready html
> >>>> files and the generated xmlc class files?
> >>>>
> >>>> With the enhydra tree, it was a cinch to use
> >>>> Dreamweaver to evolve the html pages and just build
> >>>> the app in place. It was all under
> >>>> ./presentation/resources.  With tomcat, I'm not sure
> >>>> how to handle the relative URLs (e.g., how the html
> >>>> page references gif images).    Do you use the
> >>>> urlmapping option to rename the paths from where
> >>>> dreamweaver believes the resources are to what tomcat
> >>>> wants them?
> >>>>
> >>>> Hope my question makes some sense.  Would love your
> >>>> suggestions.
> >>>>
> >>>> David
> >>>
> >>>
> >>> _______________________________________________
> >>> XMLC mailing list
> >>> [email protected]
> >>> http://www.enhydra.org/mailman/listinfo.cgi/xmlc
> >>> .
> >>
> >>
> >>
> >> -- 
> >> David H. Young
> >> SAMBA Holdings, Inc.
> >> Chief Technology Officer
> >> 1730 Montaño NW
> >> Albuquerque, NM 87107
> >> 505.797.2622 x113
> >> http://www.samba.biz
> >>
> >>
> >> _______________________________________________
> >> XMLC mailing list
> >> [email protected]
> >> http://www.enhydra.org/mailman/listinfo.cgi/xmlc
> > 
> > 
> > 
> > _______________________________________________
> > XMLC mailing list
> > [email protected]
> > http://www.enhydra.org/mailman/listinfo.cgi/xmlc
> > 
> > .
> > 
> 
> 
> -- 
> David H. Young
> SAMBA Holdings, Inc.
> Chief Technology Officer
> 1730 Montaño NW
> Albuquerque, NM 87107
> 505.797.2622 x113
> http://www.samba.biz
> 
> 
> 
> --__--__--
> 
> Message: 11
> Date: Fri, 12 Sep 2003 20:23:30 -0500
> To: [email protected]
> From: Jacob Kjome <[email protected]>
> Subject: Re: Xmlc:  biting the tomcat bullet and xmlc
> Reply-To: [email protected]
> 
> At 04:16 PM 9/12/2003 -0600, you wrote:
> >Hi Jacob...
> >
> >simple, it's clean and concise about what's new...
> 
> I guess we'll have to stick with that format then :-)
> 
> >  I thought there was one more point: xmlc is no longer dependent on an 
> > enhydra environment. Was that an earlier version or this one?
> 
> XMLC-2.1 wasn't dependent on Enhydra.  Actually, I'm not quite sure I 
> remember now.  I made a lot of changes to an earlier version  Barracuda was 
> using so that it would work in a Tomcat environment properly, but that was 
> more about clashing xerces versions than anything else.  Hmmm... I guess it 
> has been a while.  Either way, I don't think independence of Enhydra was 
> new to XMLC-2.2.
> 
> >It's been so long since I've updated enhydra pages @ enhydra.org I've 
> >completely forgotten the process.  I've pinged Christophe for some
> assistance.
> 
> I think Richard Kunze can do this as well, but he might be on vacation or 
> something.  At least someone can do it.
> 
> later,
> 
> Jake
> 
> >David
> >
> >Jacob Kjome wrote:
> >
> >>At 09:01 AM 9/12/2003 -0600, you wrote:
> >>
> >>>Thanks David... It's fun diving back into xmlc... BTW, my kudos to 
> >>>whoever wrote the release notes @ 
> >>>./xmlc-2.2/release-notes/xmlc-2-2-release-note.html
> >>
> >>I think we all had a hand in this.  I added many of the final details, 
> >>clarified a few things, and made it XHTML1.1 compliant before release.
> >>What, particularly, did you like about it?  Just curious.
> >>
> >>>I'd like to see these posted as a easily accessible link on 
> >>>xmlc.enhydra.org.
> >>
> >>I believe you have administrative rights to said site.  Can you go ahead 
> >>and put it up there?  Or did you mean for us to put it up on the 
> >>objectweb site and provide a publicly available link?
> >>You can go ahead and use this link...
>
>>http://cvs.forge.objectweb.org/cgi-bin/cvsweb.cgi/~checkout~/xmlc/release/release-notes/xmlc-2-2-release-note.html?rev=1.3&content-type=text/html&cvsroot=xmlc
> 
> >>
> >>or, in a more friendly form...
> >>http://tinyurl.com/n626
> >>later,
> >>Jake
> >>
> >>>David
> >>>
> >>>
> >>>David Li wrote:
> >>>
> >>>>Hi David,
> >>>>   Check out the samples directory in the XMLC 2.2 distribution. The 
> >>>> sample is done with Tomcat + XMLC.
> >>>>David
> >>>>
> >>>>>Hi all,
> >>>>>I'm trying to figure out how to develop html pages in
> >>>>>an xmlc & tomcat environment.  Are there any suggested
> >>>>>tomcat file hierarchies for placing xmlc-ready html
> >>>>>files and the generated xmlc class files?
> >>>>>
> >>>>>With the enhydra tree, it was a cinch to use
> >>>>>Dreamweaver to evolve the html pages and just build
> >>>>>the app in place. It was all under
> >>>>>./presentation/resources.  With tomcat, I'm not sure
> >>>>>how to handle the relative URLs (e.g., how the html
> >>>>>page references gif images).    Do you use the
> >>>>>urlmapping option to rename the paths from where
> >>>>>dreamweaver believes the resources are to what tomcat
> >>>>>wants them?
> >>>>>
> >>>>>Hope my question makes some sense.  Would love your
> >>>>>suggestions.
> >>>>>
> >>>>>David
> >>>>
> >>>>
> >>>>_______________________________________________
> >>>>XMLC mailing list
> >>>>[email protected]
> >>>>http://www.enhydra.org/mailman/listinfo.cgi/xmlc
> >>>>.
> >>>
> >>>
> >>>
> >>>--
> >>>David H. Young
> >>>SAMBA Holdings, Inc.
> >>>Chief Technology Officer
> >>>1730 Montaño NW
> >>>Albuquerque, NM 87107
> >>>505.797.2622 x113
> >>>http://www.samba.biz
> >>>
> >>>
> >>>_______________________________________________
> >>>XMLC mailing list
> >>>[email protected]
> >>>http://www.enhydra.org/mailman/listinfo.cgi/xmlc
> >>
> >>_______________________________________________
> >>XMLC mailing list
> >>[email protected]
> >>http://www.enhydra.org/mailman/listinfo.cgi/xmlc
> >>.
> >
> >
> >--
> >David H. Young
> >SAMBA Holdings, Inc.
> >Chief Technology Officer
> >1730 Montaño NW
> >Albuquerque, NM 87107
> >505.797.2622 x113
> >http://www.samba.biz
> >
> >
> >_______________________________________________
> >XMLC mailing list
> >[email protected]
> >http://www.enhydra.org/mailman/listinfo.cgi/xmlc
> 
> 
> 
> --__--__--
> 
> Message: 12
> Subject: Re: Xmlc:  Problem with implementation of getChildNodes on
> 	HTMLFormElement?
> From: Petr Stehlik <[email protected]>
> To: [email protected]
> Date: Sat, 13 Sep 2003 01:48:09 +0200
> Reply-To: [email protected]
> 
> V Pá, 12. 09. 2003 v 21:11, Jacob Kjome pí¹e:
> > >public static Vector getByClassName(Node node, String className) {
> > >testcase from the html page and share it as well.
> > 
> > Absolutely.  Any testcases that reproduce this issue are welcome. 
> 
> OK. Will do on Monday. BTW, note that it happens with Enhydra 5.0's XMLC
> (2.1alpha).
> 
> > Any idea if the issue happened on a specific type of node?  Was it an 
> > HTMLFormElement which is the issue with the current reported bug?
> 
> This is the HTML file:
> 
> <BODY>
>   <CENTER>
>     <FONT SIZE=+1> <SPAN ID="pageTitle"> report </SPAN> </FONT> <BR>
>     <FORM METHOD="GET" ACTION="Report.html">
>       <TABLE SUMMARY="report console" width="90%" BORDER="1">
>       ...
> 
> The starting node was the <BODY> and the nodes I was interested in were
> inside of the <FORM><TABLE>. But the function couldn't get any childrens
> from the FORM, IIRC.
> 
> Petr
> 
> 
> 
> 
> --__--__--
> 
> Message: 13
> Subject: Re: Xmlc:  HMLObjectImpl#toDocument() issue
> From: Petr Stehlik <[email protected]>
> To: [email protected]
> Date: Sat, 13 Sep 2003 01:37:51 +0200
> Reply-To: [email protected]
> 
> V Pá, 12. 09. 2003 v 21:03, Jacob Kjome pí¹e:
> > Note that normally one wouldn't use toDocument() anyway.
> 
> you're right. I was just afraid if it was used in Enhydra (I don't have
> its source code handy so I couldn't check).
> 
> Petr
> 
> 
> 
> 
> 
> --__--__--
> 
> _______________________________________________
> XMLC mailing list
> [email protected]
> http://www.enhydra.org/mailman/listinfo.cgi/xmlc
> 
> 
> End of XMLC Digest
>