You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Naveen Srinivasa Murthy <sm...@lycos.com> on 2001/04/24 18:03:08 UTC

Node.toString() implementation missing in Xerces?

Hi friends,

Im using the xerces 131 version jar files. Im using the DOM to
parse xmls.

Im noticing that the Node.toString() is returning empty string. I
have a node which is a tree of various elements and I expected
the node.toString() to give me a string 
like "<root><test>value</test></root>". but it is not happening and
i get an empty string.

im a previous project I used jaxp.jar and parser.jar to do xml
parsing, and when i use these jars Node.toString() gives me
the xmlstring representation of the node.

Can u suggest me any workaround to get a similar functionality just
as the node.toString()? or is xerces supporting toString() in a 
diff way or diff method call?

Thanks
Naveen





Get 250 color business cards for FREE!
http://businesscards.lycos.com/vp/fastpath/

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Node.toString() implementation missing in Xerces?

Posted by Ian Roberts <ir...@decisionsoft.com>.
On Tue, 24 Apr 2001, Naveen Srinivasa Murthy wrote:

> Im noticing that the Node.toString() is returning empty string. I
> have a node which is a tree of various elements and I expected
> the node.toString() to give me a string 
> like "<root><test>value</test></root>". but it is not happening and
> i get an empty string.
> 
> im a previous project I used jaxp.jar and parser.jar to do xml
> parsing, and when i use these jars Node.toString() gives me
> the xmlstring representation of the node.
> 
> Can u suggest me any workaround to get a similar functionality just
> as the node.toString()? or is xerces supporting toString() in a 
> diff way or diff method call?

org.apache.xml.serialize.XMLSerializer does what you want.  There have
been a number of code examples posted here in the past, if you need them.

Ian

-- 
Ian Roberts, Software Engineer        DecisionSoft Ltd.
Telephone: +44-1865-203192            http://www.decisionsoft.com


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org