1

Tibco BusinessWorksを使用して、XMLドキュメントをTibcoBusinessEventsプロセスに渡します。BusinessEventsにはDATE形式がなく、DATETIMEのみであるため、BusinessEventsに送信する前にソースXMLドキュメントのDatesを変更し、応答のDateTime値を単純なDatesにマップする必要があります。

これは面倒で面倒です。

BusinessWorksのパフォーマンスを向上させるために、マッピングを処理するためのスタイルシートを作成しています。これが私が持っているものです。

<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:inf="http:/the.company.namespace">

<xsl:template match="node()">
    <xsl:copy>
        <xsl:apply-templates select="node()" />
    </xsl:copy>
</xsl:template>

<xsl:template match="inf:PriorExpirationDate | inf:OrderDate | inf:SegmentEffectiveDate |
                    inf:SegmentExpirationDate | inf:CancelDate | inf:NewBusinessEffectiveDate |
                    inf:NewBusinessExpirationDate | inf:RenewalEffectiveDate | inf:RenewalExpirationDate |
                    inf:QuestionDate | inf:ViolationDate | inf:ConvictionDate |
                    inf:EffectiveDate | inf:RatingDate | inf:AdvanceDate |
                    inf:SIDRevisionDate | inf:DriverLicensedDate |
                    inf:ESignatureDate | inf:UploadDate | inf:CancelDate |
                    inf:CancelProcessedDate | inf:CancelEffectiveDate | inf:CreatedDate |
                    inf:QuoteCreationDate | inf:QuoteModifiedDate | inf:QuoteExpirationDate |
                    inf:RateStartDate | inf:RateEndDate | inf:ChangeEffectiveDate | inf:PostDate |
                    inf:EffectiveDate | inf:ExpirationDate | inf:BirthDate |
                    inf:InstallmentDueDate | inf:CommercialDriverLicenseDate ">
    <xsl:element name="{name()}">
        <xsl:value-of
            select="concat(format-date(text(),'[Y0001]-[M01]-[D01]'), 'T00:00:00')" />
    </xsl:element>
</xsl:template>

機能的ですが、これは理想的ではありません。変換する必要のある各要素を列挙する必要はなく、変換する必要のあるTYPEを指定したいと思います。

(1) XSLはこの機能を提供しますか?

(2)あるいは、ある場所ではDATEであり、他の場所ではDATETIMEである要素名がいくつかあります。親を名前で知っている場合、一部のDATETIME要素を除外する効率的な方法はありますか?

(3)最後に、質問の範囲を超えて強化の余地があると思う人はいますか?

コンテキスト:元のマッピングはBusinessWorksのエディター内で行われ、GUIが独自のマッピングファイルである数百行の一連のif / then/elseステートメントを生成します。50kのドキュメント(平均)の場合、これは、実際の作業を50ミリ秒未満で完了するWebサービスの変換ごとに約20ミリ秒のオーバーヘッドになります。これは、改善しなければならないボトルネックです。

4

1 に答える 1

2

使用するだけです:

<xsl:template match="*[. castable as xs:date]">
 <!-- Your code here -->
</xsl:template>
于 2013-03-14T04:04:10.583 に答える