OK,
The code is like
DocumentBuilderFactory
factory=DocumentBuilderFactory.newInstance();
DocumentBuilder builder=factory.newDocumentBuilder();
Document doc=builder.parse(new File("c:/a.xml");
String
value=doc.getChildNodes().item(0).getChildNodes().item(0).getNodeValue();
//value come back something like ||
a.xml
<?xml version="1.0" ?>
<a>
<b>This is a test</b>
</a>
thanks/lance
--- Xuemin Guan <[EMAIL PROTECTED]> wrote:
> When posting such a question, it will be very
> helpful if the code snippet
> and xml sample
> file can be included.
>
> ----- Original Message -----
> 送信�?: "Lance Zhang" <[EMAIL PROTECTED]>
> 宛先 : <[EMAIL PROTECTED]>
> 送信日時 : 2002�?�?8�?18:09
> 件名 : Problem in Dom parser
>
>
> > Hi,
> >
> > I got a problem when using DOM parser in
> > javax.xml.parsers package.
> >
> > I can not use getNodeValue() to get a text node
> value.
> > It return me some strange characters in doing that
> > although it is a very simple xml file.
> >
> > Also, the node.getElementsByTagName always return
> me
> > an empty nodelist although it was obvious not
> null.
> >
> > Does anyone have same kind of experience? does
> this
> > related to the encoding?
> >
> > thanks/Lance
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Movies - coverage of the 74th Academy
> Awards®
> > http://movies.yahoo.com/
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards�
http://movies.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]