Re: Min/Max date in a map...
- From: Pabba <kiran.pabba@xxxxxxxxx>
- Date: Thu, 14 Jun 2007 09:31:06 -0700
Thanks for your detailed advice,
First to clarify I'm using ONLY xml strings and not date, date-time or
other complex types. Since the data I'm working on is in date format
though represented as strings in xml my concern is, to achieve a
simple min/max logic I have to go through so many conversions which
may hinder the overall map performance.
As per design there is one more map (map1) before the current map
(map2) thus I'm doing the first level date format conversion in map1
(to enable sort on date values - yyyymmdd) and implementing the min/
max logic using xsl:sort in map2 and finally converting the min/max
values to expectd mm/dd/yyyy format and returning it to the target
nodes in cusotm xslt functoid. Eveything works fine, now I need to
monitor the performance.
Thanks again,
Kiran Pabba
On Jun 14, 11:35 am, Leonid Ganeline
<LeonidGanel...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I think the Xml and Xslt are not for type conversions, not for typed
information.
Keep in mind the Xml is all about transmittind data from one point to
others. Serialize data and pass is. Producer and consumer of the data knows
about formats, not the transmitter. For transmitter point of view the all
data are STRINGS. It's quite unlikly to work with types into intermediate
leyer.
Moreover the xml type the date is... not for quick and reliable and unified
works. It's disaster.
My advise, always try to work in xml and xslt with strings. Use other types
only as exceptions.
If your case is in transfering data between SQL stores then SQL would
transform date formats easily.
Regards,
Leonid Ganelinehttp://geekswithblogs.net/leonidganeline/
"Pabba" wrote:
Since data is in date format the implementation is becoming more
complex. The input date value is in 'yyyy-mm-ddThh:mm:ss' format and
the expected output date format on the target is 'mm/dd/yyyy' format.
Thus the sequence of logic should be like:
1. Convert input date values from 'yyyy-mm-ddThh:mm:ss' to
'yyyymmdd' (to enable sort)
2. Apply xsl:sort on 'yyyymmdd' date values and extract min and max
dates in the loop
4. Convert min and max 'yyyymmdd' date format to 'mm/dd/yyyy' date
format
I don't see a straight-forward way to implement this in a Custom
Inline XSLT functoid since multiple conversions of whole recordset
should happen on the fly before xsl:sort. Please let me know your
views in going forward.
Thanks in advance,
Kiran Pabba
On Jun 13, 5:08 pm, Pabba <kiran.pa...@xxxxxxxxx> wrote:
Thanks for your reply, I'll try that and update you.
Kiran
On Jun 13, 5:02 pm, Leonid Ganeline
<LeonidGanel...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I suggest using of xsl:sort
then using filters [1] and last() in XPath.
"Pabba" wrote:
Yes,
Example - Source Message:
<Source>
<Record>
<Name>A</Name>
<RegistrationDate>06/01/2007</RegistrationDate>
</Record>
<Record>
<Name>B</Name>
<RegistrationDate>06/02/2007</RegistrationDate>
</Record>
<Record>
<Name>C</Name>
<RegistrationDate>05/20/2007</RegistrationDate>
</Record>
<Record>
<Name>D</Name>
<RegistrationDate>06/03/2007</RegistrationDate>
</Record>
<Record>
<Name>E</Name>
<RegistrationDate>06/04/2007</RegistrationDate>
</Record>
<Record>
<Name>H</Name>
<RegistrationDate>05/11/2007</RegistrationDate>
</Record>
<Record>
<Name>F</Name>
<RegistrationDate>06/05/2007</RegistrationDate>
</Record>
<Record>
<Name>G</Name>
<RegistrationDate>06/06/2007</RegistrationDate>
</Record>
<Record>
<Name>I</Name>
<RegistrationDate>06/10/2007</RegistrationDate>
</Record>
</Source>
Expected Target Message:
<Target>
<Record>
<MaxDate>06/10/2007</MaxDate>
<MinDate>05/11/2007</MinDate>
</Record>
</Target>
Please let me know if this is possible in the XSLT script functoid.
Thanks,
Kiran
On Jun 13, 3:34 pm, Leonid Ganeline
<LeonidGanel...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Min/Max values between several values in source Xml?
Could you, please, give an example?
"Pabba" wrote:
Hi,
Is it possible to get min and max values from a date element using
XSLT in BizTalk map.
Thanks,
Kiran
.
- Follow-Ups:
- Re: Min/Max date in a map...
- From: Leonid Ganeline
- Re: Min/Max date in a map...
- References:
- Min/Max date in a map...
- From: Pabba
- Re: Min/Max date in a map...
- From: Pabba
- Re: Min/Max date in a map...
- From: Leonid Ganeline
- Re: Min/Max date in a map...
- From: Pabba
- Re: Min/Max date in a map...
- From: Pabba
- Re: Min/Max date in a map...
- From: Leonid Ganeline
- Min/Max date in a map...
- Prev by Date: RE: Envelope
- Next by Date: Re: Multiple Record Types In Flat File Merged Into One Record In Desti
- Previous by thread: Re: Min/Max date in a map...
- Next by thread: Re: Min/Max date in a map...
- Index(es):
Relevant Pages
|