jkesselm 2002/10/29 12:38:00 Modified: java/src/org/apache/xpath/objects Tag: xslt20 XDTMSequence.java Log: Support the derived types in XPath's xf: namespace Revision Changes Path No revision No revision 1.1.2.1.2.1 +10 -4 xml-xalan/java/src/org/apache/xpath/objects/Attic/XDTMSequence.java Index: XDTMSequence.java =================================================================== RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/objects/Attic/XDTMSequence.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.1.2.1 diff -u -r1.1.2.1 -r1.1.2.1.2.1 --- XDTMSequence.java 14 Aug 2002 20:07:03 -0000 1.1.2.1 +++ XDTMSequence.java 29 Oct 2002 20:38:00 -0000 1.1.2.1.2.1 @@ -377,16 +377,22 @@ // DateTimeObj would be more efficient but bind us // explicitly to Xerces' current stopgap... // - // Durations are treated similarly. + // Durations are treated similarly. Note that we have to deal with + // the derived duration types defined by the XPath/XSLT/XQuery group. if(value instanceof int[]) { - if("duration".equals(getTypeLocalName()) && - XType.XMLSCHEMA_NAMESPACE.equals(getTypeNS())) + String typeNS=getTypeNS(),typeLocalName=getTypeLocalName(); + if("duration".equals(typeLocalName) && + XType.XMLSCHEMA_NAMESPACE.equals(typeNS) || + ("http://www.w3.org/2002/10/xquery-functions".equals(typeNS) && + ("yearMonthDuration".equals(typeLocalName) || + "dayTimeDuration".equals(typeLocalName))) + ) value=new Duration((int[])value); else // It's a date of some flavor { - DateTimeObj dt=new DateTimeObj((int[])value,getTypeLocalName()); + DateTimeObj dt=new DateTimeObj((int[])value,typeLocalName); // The following is only good enough for now. Needs more work. -sb int t = getValueType(pos);
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]