0

フォームには、日付と時刻の値をユーザーのローカル タイム ゾーンに変換する特別な機能があります。xfdl バージョン 8 で既に利用可能なadjust-dateTime-to-timezone()日付関数があることを知ったので、それを使用してみました。

ただし、Tue Jul 17 21:49:28 2012 0 Viewer : xforms-compute-exception: adjust-dateTime-to-timezone(../utcDT) というエラーが表示され続けます。

実際のソースコードはこちら。

<XFDL xmlns:custom="http://www.ibm.com/xmlns/prod/XFDL/Custom" xmlns:designer="http://www.ibm.com/xmlns/prod/workplace/forms/designer/2.6" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xfdl="http://www.ibm.com/xmlns/prod/XFDL/8.0" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns="http://www.ibm.com/xmlns/prod/XFDL/8.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<globalpage sid="global">
    <global sid="global">
        <designer:date>20120717</designer:date>
        <formid>
            <title/>
            <serialnumber></serialnumber>
            <version>1.0.0</version>
        </formid>
        <pageloading>
            <ondemand>enable</ondemand>
        </pageloading>
        <transmitformat>application/vnd.xfdl;content-encoding=base64-gzip</transmitformat>
        <saveformat>application/vnd.xfdl;content-encoding=base64-gzip</saveformat>
        <xformsmodels>
            <xforms:model>
                <xforms:instance id="formData" xmlns="">
                    <root>
                        <utcDT>2011-09-01T23:00:01Z</utcDT>
                        <!-- UTC dateTime -->
                        <localDT>2011-09-01T23:00:01Z</localDT>
                        <!-- local dateTime with the timezone (accounting for daylight saving correction) -->
                    </root>
                </xforms:instance>
                <xforms:bind nodeset="utcDT | localDT" type="xforms:dataTime"/>
                <xforms:bind calculate="adjust-dateTime-to-timezone(../utcDT)" nodeset="localDT"/>
            </xforms:model>
        </xformsmodels>
        <history>
            <editors>
                <editor minversion="3.5.1" version="4.0.0">IBM Forms Designer</editor>
            </editors>
        </history>
    </global>
</globalpage>
<page sid="PAGE1">
    <global sid="global">
        <label>PAGE1</label>
    </global>
    <label sid="l2">
                <xforms:output ref="localDT">
                    <xforms:label>Local dateTime = </xforms:label>
                </xforms:output>
    </label>
    <spacer sid="vfd_spacer">
        <itemlocation>
            <x>960</x>
            <y>1260</y>
            <width>1</width>
            <height>1</height>
        </itemlocation>
    </spacer>
</page>

あなたの助けに感謝します!前もって感謝します!

ケリーから

4

1 に答える 1

1

の最初の引数は であるadjust-dateTime-to-timezone必要があり、xs:dateTimeここでは要素を渡しています。代わりに、次のように記述します。

adjust-dateTime-to-timezone(xs:dateTime(../utcDT))
于 2012-07-20T00:45:17.003 に答える