我有一个 XSLT 模板可以转换它:
<WGS__LAT>N20340000</WGS__LAT>
对此:
<latitude>
<deg>20</deg>
<min>34</min>
<sec>00</sec>
<hSec>00</hSec>
<northSouth>North</northSouth>
</latitude>
我写了一个 XSpec 场景来测试 XSLT 模板:
<x:scenario label="location/latitude: Check that the XSLT assigns latitude the split-up value of WGS__LAT">
<x:context>
<WGS__LAT>N20340000</WGS__LAT>
</x:context>
<x:expect label="Expect: deg=20, min=34, sec=00, hSec=00, northSouth=North">
<latitude>
<deg>20</deg>
<min>34</min>
<sec>00</sec>
<hSec>00</hSec>
<northSouth>North</northSouth>
</latitude>
</x:expect>
</x:scenario>
我确定我的 XSLT 模板可以正常工作,那么为什么 XSpec 工具会报告 FAILED?我认为这可能与 <x:expect> 中的空格有关,所以我删除了所有空格:
<x:expect label="Expect: deg=20, min=34, sec=00, hSec=00, northSouth=North">
<latitude><deg>20</deg><min>34</min><sec>00</sec><hSec>00</hSec><northSouth>North</northSouth></latitude>
</x:expect>
不幸的是,我仍然失败了。我究竟做错了什么?