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 Martin Bosticky <mb...@aimltd.co.uk> on 2002/12/27 15:49:58 UTC

extracting information from a duration attribute

Hi

I have XML schema with xsd:duration attribute in it.

Is there a convenient tool in xercesc that can help parsing durations?
Ie xsd:duration type. I have investigated the XMLDateTime class which
has a parseDuration() on it but there is nothing that can be used to
retrieve the parsed data.

So to get the duration time in seconds it looks to me like I will have
to write code to parse things like: 'P1Y2M3DT10H30M' manually? I have
tried getString() which is supposed to return the value in decimals but
that just returns the 'P1Y2M3DT10H30M' back to me.

Any suggestions really appreciated, Martin.



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


Re: extracting information from a duration attribute

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

	nothing that I know of inside xerces-c. We are currently 
implementing XPath2 module for xerces-c. We have internal classes that do 
this. Check out software.decisionsoft.com and look for Pathan 2. It is 
alpha and we about to break it because of the newly released WD spec but I 
think it should help you.

Gareth 



On Fri, 27 Dec 2002, Martin Bosticky wrote:

> Hi
> 
> I have XML schema with xsd:duration attribute in it.
> 
> Is there a convenient tool in xercesc that can help parsing durations?
> Ie xsd:duration type. I have investigated the XMLDateTime class which
> has a parseDuration() on it but there is nothing that can be used to
> retrieve the parsed data.
> 
> So to get the duration time in seconds it looks to me like I will have
> to write code to parse things like: 'P1Y2M3DT10H30M' manually? I have
> tried getString() which is supposed to return the value in decimals but
> that just returns the 'P1Y2M3DT10H30M' back to me.
> 
> Any suggestions really appreciated, Martin.
> 
> 
> 
> ---------------------------------------------------------------------
> 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, Head of Product Development  +44-1865-203192
DecisionSoft Limited                        http://www.decisionsoft.com
XML Development and Services




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