Hi Cheluus,
if you don't us a dtd for your document, the xml parser could not identify the characters between the start tag of <TEST> and start tag of <NODE1> as ignorable whitespaces. Therefore your tag <TEST> has three children: one text node containing the carriage return plus your indent of <NODE1>, one element node for <NODE1> and another text node containing the carriage return after the end tag of <NODE1> and your indent of the end tag of <TEST>.
Therefore you'll have to use a DTD or your program have to be prepared to find those text nodes. Instead of treating the result of getFirstChildNode as an element node, you can test whether it is a text node containing only whitespace characters and move to the next sibling.
Hope this helps,
HolgeR
BTW: This is not a xalan related question.
Challapathi schrieb:
Hello,
XalanNode.getFirstChildNode not working properly.
My Xml is :
<ROOT>
<TEST>
<NODE1> AAAAAAAAA</NODE1>
</TEST>
</ROOT>
I got the XalanNode, using XPATH ROOT/TEST,
Then Called getFirstChildNode , it is returning TextNode, it should be Element Node.
But, if I change XML bellow, it works fine
<ROOT><TEST><NODE1> AAAAAAAAA</NODE1></TEST></ROOT>
Please let me know. Thanks in advance.
Bye
Cheluus
------------------------------------------------------------------------
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard <http://us.rd.yahoo.com/mail_us/taglines/spamguard/*http://promotions.yahoo.com/new_mail/static/protection.html>.
-- holger floerke d o c t r o n i c email [EMAIL PROTECTED] information publishing + retrieval phone +49 2222 9292 90 http://www.doctronic.de
