Re: Min/Max date in a map...



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


.



Relevant Pages

  • new lame effort, self-compressed bin-xml...
    ... hell, I use xml, partly because it ... (likewise, my format supports namespaces, which is imo a plus). ... for the most part strings are merged via mru caching. ...
    (comp.compression)
  • Re: Sane Syntax
    ... vital role in the future of TeX but we need some more human friendly ... Generating well formed LaTeX2e documents from XML ... Another approach is to convert existing documents to XML format and go ... TEI, together with DocBook, are the two ...
    (comp.text.tex)
  • Re: XHTML vs HTML
    ... to be the predominant type of HTML used on the web for many years yet. ... First, it is XML. ... XHTML is also ... transformed using XSL from and into virtually *any* other data format. ...
    (microsoft.public.frontpage.programming)
  • Re: text to bibliography?
    ... to xml: you can store binary data in an xml file. ... including your well-formattedbibliography(no longer in xml format). ... It is in annotated bibliographies (something Word 2007 does not ... that %I is actually the field representing the publisher. ...
    (microsoft.public.word.docmanagement)
  • Re: Future of LISP. Alternative to XML. Web 3.0?
    ... using s-expressions instead of XML, nobody is going to use it, ... because it's cheaper to keep the existing XML software and continue ... XML-MAIDEN format or to HTML format and next displayed via standard ... or a CanonML or LISP browser. ...
    (comp.lang.lisp)

Quantcast