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 Uli Franke <ul...@weiss.ch> on 2005/09/08 20:57:53 UTC

DOM numerical elements

Hi there

I'm new to the DOM/xerces stuff. So far i've built my first writers and
readers using the examples from the webpage (by serializing
(root)nodes). Additionally I've assembled some documents using DOM and
text-nodes/elements.

But since the main focus of my xml-implementation lies on saving lots of
numbers (floating-point/double integer) into a XML document, I wonder
how I can do that. The result should look like:

...
<myVeryImportantData>
	<importantNumber>3.1415926</importantNumber>
	<howTheWorldWillBe>-1984</howTheWorldWillBe>
	<theRootOfAllEvil>1.414213562</theRootOfAllEvil>
</myVeryImportantData>
...

I have not seen any DOMNumber or DOMFloat nodes and I can not figure out
how I can use XMLFloat/Number (or if it is suitable at all). What did I
miss?

Thanks a lot

uli

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


Re: DOM numerical elements

Posted by db...@qis.net.
Convert the numbers to Strings

String.valueOf(myDouble);

and add them as Text type nodes.

Quoting Uli Franke <ul...@weiss.ch>:

> Hi there
> 
> I'm new to the DOM/xerces stuff. So far i've built my first writers and
> readers using the examples from the webpage (by serializing
> (root)nodes). Additionally I've assembled some documents using DOM and
> text-nodes/elements.
> 
> But since the main focus of my xml-implementation lies on saving lots of
> numbers (floating-point/double integer) into a XML document, I wonder
> how I can do that. The result should look like:
> 
> ...
> <myVeryImportantData>
> 	<importantNumber>3.1415926</importantNumber>
> 	<howTheWorldWillBe>-1984</howTheWorldWillBe>
> 	<theRootOfAllEvil>1.414213562</theRootOfAllEvil>
> </myVeryImportantData>
> ...
> 
> I have not seen any DOMNumber or DOMFloat nodes and I can not figure out
> how I can use XMLFloat/Number (or if it is suitable at all). What did I
> miss?
> 
> Thanks a lot
> 
> uli
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org
> 




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