【发布时间】:2013-07-05 11:42:31
【问题描述】:
我在 BizTalk 中使用 xslt 将 edifact 文件转换为 UBL 文件的项目。 edifact 文件包含 ###.0 的价格值,并且不起作用。我想使用格式号将其更改为###.00。但我不能让它工作。
这是我到目前为止所做的:
<cbc:Value>
<xsl:variable name="SumOfNodes" select="edi:PRI/edi:C509/C50902"/>
<xsl:value-of select="format-number($SumOfNodes, '0.00')"/>
</cbc:Value>
我正在使用这个样式表:
<?xml version="1.0" encoding="utf-16"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:edi="http://schemas.microsoft.com/BizTalk/EDI/EDIFACT/2006/MEDIAMARKT"
xmlns:ubl="urn:oasis:names:specification:ubl:schema:xsd:Order-2"
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
exclude-result-prefixes="msxsl edi">
关于如何解决这个问题的任何想法?
【问题讨论】:
-
这给了你什么?
-
错误:2(字段级错误) SegmentID:PRI TS 中的位置:87 数据元素 ID:C50902 段中的位置:2 字段中的位置:2 数据值:86.0 37:无效字符在数据元素中找到
-
那么该段中有哪些数据?
-
您的错误消息表明实际值为
86.0 37。你检查过源文件吗? -
您能否提供一个示例输入文件,这将很有帮助。