You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Bettina Reck <Be...@gmx.de> on 2004/05/27 17:30:02 UTC

Converting float to XMLFloat

Dear all,

I am new to Xerces-c-parser and I have the following question:

I am using the DOMWriter to serialize an XML-file which I created before
using the DOMBuilder class. Some of my text-nodes have a float value so how
can I arrange to convert my float-value-input into the XMLFloat-type (as
this class expects an XMLCh-type as an input)?

Thanks for any help!

Bettina

-- 
NEU : GMX Internet.FreeDSL
Ab sofort DSL-Tarif ohne Grundgeb�hr: http://www.gmx.net/dsl


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


Re: Converting float to XMLFloat

Posted by Bettina Reck <Be...@gmx.de>.
Hi, Gareth!

Thanks again for your answer! In the meantime I solved my "problem" - I just
had to convert my input data with sprintf() to a char* and then further on
via XMLString::transcode().... 

Bettina

> Hi,
> 	where are these inputs coming from? Are they actually XMLFloat
> types? If they are, take a look at the API for XMLFloat. There are methods
> there that will help you. If not, explain your situation in more detail
> and I will try to help.
> 
> Gareth
> 
> On Fri, 28 May 2004, Bettina Reck wrote:
> 
> > Thanks for the answer!
> >
> > The DOM document element nodes consist of text nodes and therefor are of
> > XMLCh datetype - that's clear to me. But in my task I have to build an
> XML
> > file according to a given schema of several input values and some of
> them
> > are floats. So is there a save way for the floats to be converted to the
> > XMLCh type?
> >
> > Bettina
> >
> > > Hi,
> > >
> > > On Thu, 27 May 2004, Bettina Reck wrote:
> > >
> > > > Dear all,
> > > >
> > > > I am new to Xerces-c-parser and I have the following question:
> > > >
> > > > I am using the DOMWriter to serialize an XML-file which I created
> before
> > > > using the DOMBuilder class. Some of my text-nodes have a float value
> so
> > > how
> > >
> > > You hit the nail on the head there. They are text nodes. You cannot
> > > create XML Float types and attach them to the DOM. You can write a
> schema
> > > and validate the document - then it will have the type Float
> > >
> > >
> > > > can I arrange to convert my float-value-input into the XMLFloat-type
> (as
> > > > this class expects an XMLCh-type as an input)?
> > >
> > > If you for some reason have XML Floats, you can call getRawData to
> return
> > > the XMLCh.
> > >
> > > Gareth
> > >
> > >
> > > --
> > > Gareth Reakes, Managing Director      Parthenon Computing
> > > +44-1865-811184                  http://www.parthcomp.com
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> > >
> >
> >
> 
> -- 
> Gareth Reakes, Managing Director      Parthenon Computing
> +44-1865-811184                  http://www.parthcomp.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 

-- 
+++ Jetzt WLAN-Router f�r alle DSL-Einsteiger und Wechsler +++
GMX DSL-Powertarife zudem 3 Monate gratis* http://www.gmx.net/dsl


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


Re: Converting float to XMLFloat

Posted by Gareth Reakes <ga...@parthenoncomputing.com>.
Hi,
	where are these inputs coming from? Are they actually XMLFloat
types? If they are, take a look at the API for XMLFloat. There are methods
there that will help you. If not, explain your situation in more detail
and I will try to help.

Gareth

On Fri, 28 May 2004, Bettina Reck wrote:

> Thanks for the answer!
>
> The DOM document element nodes consist of text nodes and therefor are of
> XMLCh datetype - that's clear to me. But in my task I have to build an XML
> file according to a given schema of several input values and some of them
> are floats. So is there a save way for the floats to be converted to the
> XMLCh type?
>
> Bettina
>
> > Hi,
> >
> > On Thu, 27 May 2004, Bettina Reck wrote:
> >
> > > Dear all,
> > >
> > > I am new to Xerces-c-parser and I have the following question:
> > >
> > > I am using the DOMWriter to serialize an XML-file which I created before
> > > using the DOMBuilder class. Some of my text-nodes have a float value so
> > how
> >
> > You hit the nail on the head there. They are text nodes. You cannot
> > create XML Float types and attach them to the DOM. You can write a schema
> > and validate the document - then it will have the type Float
> >
> >
> > > can I arrange to convert my float-value-input into the XMLFloat-type (as
> > > this class expects an XMLCh-type as an input)?
> >
> > If you for some reason have XML Floats, you can call getRawData to return
> > the XMLCh.
> >
> > Gareth
> >
> >
> > --
> > Gareth Reakes, Managing Director      Parthenon Computing
> > +44-1865-811184                  http://www.parthcomp.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> >
>
>

-- 
Gareth Reakes, Managing Director      Parthenon Computing
+44-1865-811184                  http://www.parthcomp.com

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


Re: Converting float to XMLFloat

Posted by Bettina Reck <Be...@gmx.de>.
Thanks for the answer!

The DOM document element nodes consist of text nodes and therefor are of 
XMLCh datetype - that's clear to me. But in my task I have to build an XML
file according to a given schema of several input values and some of them
are floats. So is there a save way for the floats to be converted to the
XMLCh type?

Bettina 

> Hi,
> 
> On Thu, 27 May 2004, Bettina Reck wrote:
> 
> > Dear all,
> >
> > I am new to Xerces-c-parser and I have the following question:
> >
> > I am using the DOMWriter to serialize an XML-file which I created before
> > using the DOMBuilder class. Some of my text-nodes have a float value so
> how
> 
> You hit the nail on the head there. They are text nodes. You cannot
> create XML Float types and attach them to the DOM. You can write a schema
> and validate the document - then it will have the type Float
> 
> 
> > can I arrange to convert my float-value-input into the XMLFloat-type (as
> > this class expects an XMLCh-type as an input)?
> 
> If you for some reason have XML Floats, you can call getRawData to return
> the XMLCh.
> 
> Gareth
> 
> 
> -- 
> Gareth Reakes, Managing Director      Parthenon Computing
> +44-1865-811184                  http://www.parthcomp.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 

-- 
"Sie haben neue Mails!" - Die GMX Toolbar informiert Sie beim Surfen!
Jetzt aktivieren unter http://www.gmx.net/info


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


Re: Converting float to XMLFloat

Posted by Gareth Reakes <ga...@parthenoncomputing.com>.
Hi,

On Thu, 27 May 2004, Bettina Reck wrote:

> Dear all,
>
> I am new to Xerces-c-parser and I have the following question:
>
> I am using the DOMWriter to serialize an XML-file which I created before
> using the DOMBuilder class. Some of my text-nodes have a float value so how

You hit the nail on the head there. They are text nodes. You cannot
create XML Float types and attach them to the DOM. You can write a schema
and validate the document - then it will have the type Float


> can I arrange to convert my float-value-input into the XMLFloat-type (as
> this class expects an XMLCh-type as an input)?

If you for some reason have XML Floats, you can call getRawData to return
the XMLCh.

Gareth


-- 
Gareth Reakes, Managing Director      Parthenon Computing
+44-1865-811184                  http://www.parthcomp.com

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