Biztalk XSLT: how to use replace function ?

LALITHA KRISHNA 41 Reputation points
2022-06-01T10:38:45.437+00:00

hi Experts,

i have a scenario to convert the dateTime filed in XSLT via replace function

input1: 2019-08-12T12:59:26+01:00

output1:1259
output2:+
output3:0100

How can i acheive this in xslt without calling the c# method or (CDATA)?

Microsoft BizTalk Server
Microsoft BizTalk Server
A family of Microsoft server products that support large-scale implementation management of enterprise application integration processes.
349 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,190 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,279 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Kamlesh Kumar 3,861 Reputation points
    2022-06-02T13:41:37.31+00:00

    Hi There,

    Thank you for asking this question on the Microsoft Q&A Platform.

    Yes, you can achieve it using XSLT and try with substring and replace function. Adding a sample piece of XSLT code that would be helpful for you.

    <date value="2019-08-12T12:59:26+01:00"/>  
       
    <xsl:variable name="date" select="substring-after(@value, 'T')"/>  
    <xsl:variable name="h" select="substring-before($date, '+')"/>  
    <xsl:variable name="m-s" select="substring-after($date, '+')"/>         
      
    <xsl:value-of select="replace($h,':','')"/>  
    <xsl:value-of select="replace($m-s,':','')"/>  
    

    Regards,
    Kamlesh Kumar
    BizTalk Techie

    Please don't forget to click on 205836-130616-image.png or upvote 205759-130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is How

    Want a reminder to come back and check responses? Here is how to subscribe to a Notification

    If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

    0 comments No comments