如何在Biztalk自定义xslt中编写xsl函数? Biztalk支持xsl 1.0版,因此许多功能都不可用。那么如何在我的自定义xslt中编写一个函数来在日期字段中添加一个月? [英] how to write a xsl function in Biztalk custom xslt? Biztalk support xsl version 1.0, so many of the functions are not available. So how to write a function in my custom xslt to add a month in date field?

查看:57
本文介绍了如何在Biztalk自定义xslt中编写xsl函数? Biztalk支持xsl 1.0版,因此许多功能都不可用。那么如何在我的自定义xslt中编写一个函数来在日期字段中添加一个月?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请不要通过C sharp函数提供ans解决方案

Please dont provide ans where solution is through C sharp functions

推荐答案

到目前为止你做了什么?

What have you done so far?

为什么排除C#脚本或静态助手类都是合法的解决方案,如果你正在编写一个msxml解析器,则广泛使用。

Why exclude C# scripts or static helper classes both are legit solutions and widely used if you are coding for the an msxml parser

XSL函数是基本上是一个模板,可以通过名称调用,也可以通过与xpath的匹配来计算。
https://www.w3schools.com/xml/xsl_templates.asp

An XSL function is basically a template either called by a name or through a match to an xpath
https://www.w3schools.com/xml/xsl_templates.asp

首先你需要将日期分成它的元素,例如年,月,日期

添加30天,然后检查"溢出"。与当月相比,增加月份并将当天设置为溢出

First you need to split the date into it's elements eg year, month, date
Add 30 days and check the "overflow" compared to current month, increase month and set the day to the overflow

代码变得庞大而丑陋 

The code gets huge and ugly 

灵感

https://stackoverflow.com/questions/10689099/expanding-datetime-ranges-in-xslt-1-0

https://stackoverflow.com/questions/23566734/date-operations-on-xsl-1-0

E DIT:第二个链接中的示例:日期转换为Julian日期格式,添加
天并且t母鸡转换回格里高利格式

缩写词

JDN:朱利安日期数字

GD:格里高利日期

EDIT: Example in the second link: Date is converted to Julian Date format, days are added and then converted back to the Gregorian format
Abbrevations
JDN: Julian Date Numeric
GD: Gregorian Date

/ Peter


这篇关于如何在Biztalk自定义xslt中编写xsl函数? Biztalk支持xsl 1.0版,因此许多功能都不可用。那么如何在我的自定义xslt中编写一个函数来在日期字段中添加一个月?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆