logo       

Re: cloning nodes vs. creating new() ones: msg#00085

java.enhydra.xmlc

Subject: Re: cloning nodes vs. creating new() ones

At 10:43 AM 9/16/2003 +0200, you wrote:
Use the generated method "setTextTeacherName(String)". This sets the content
of the first descendant of the node with id "teacherName". In your example,
thats the first child (i.e. the same node you are using), but the difference
is that "setText....()" doesn't break the template if e.g. the designer
decides to make the text bold.

One other option that Mathew can use is XMLCUtil.findFirstText(Node) to get the first text child of a node whether it be the first child or deeper. This also allows one to avoid breaking things even if the designer adds extra tags like <b>. However, it still isn't quite as good as using setTextTeacherName(String) which allows you to validate things at compile time, rather than waiting for a runtime error if it doesn't exist.

Jake

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise