我需要一些XSLT帮助来检查每个源<Info>
元素与@Type="bar"
。XSLT在映射之前检查内容
如果他们的孩子<Ref>
元素在孩子包含的<Info>
元素<Ref>
元素与@Type="foo"
, 我想与目标具有相同<Refs>
创建@Type="foo"
一个<Info>
。
我在XSLT中缺少动态updatebale变量而苦恼!下面
来源
<?xml version="1.0" encoding="UTF-8"?>
<Infos>
<Info Type="foo">
<Refs>
<Ref>1</Ref>
<Ref>2</Ref>
<Ref>3</Ref>
</Refs>
<Content>FOO CONTENT</Content>
</Info>
<Info Type="bar">
<Refs>
<Ref>1</Ref>
<Ref>2</Ref>
</Refs>
<Content>BAR 1 CONTENT</Content>
</Info>
<Info Type="bar">
<Refs>
<Ref>3</Ref>
</Refs>
<Content>BAR 2 CONTENT</Content>
</Info>
<Info Type="bar">
<Refs>
<Ref>4</Ref>
</Refs>
<Content>BAR 3 CONTENT</Content>
</Info>
</Infos>
预期目标
<?xml version="1.0" encoding="UTF-8"?>
<Infos>
<Info Type="foo">
<Refs>
<Ref>1</Ref>
<Ref>2</Ref>
</Refs>
<Content>FOO CONTENT</Content>
</Info>
<Info Type="foo">
<Refs>
<Ref>3</Ref>
</Refs>
<Content>FOO CONTENT</Content>
</Info>
<Info Type="bar">
<Refs>
<Ref>1</Ref>
<Ref>2</Ref>
</Refs>
<Content>BAR 1 CONTENT</Content>
</Info>
<Info Type="bar">
<Refs>
<Ref>3</Ref>
</Refs>
<Content>BAR 2 CONTENT</Content
</Info>
<Info Type="bar">
<Refs>
<Ref>4</Ref>
</Refs>
<Content>BAR 3 CONTENT</Content
</Info>
</Infos>
所以注意作为原始创建了两个富元素有裁判1,2
查看源和预期目标, 3,并有一个酒吧1,2和一个酒吧与3.
此外,原始条形图元素完全按照来源映射。
所需的逻辑根本不清楚。 ''出现在'foo'和'bar'下面;为什么要区别对待? –
我更新了目标,使其具有与源代码相同的顺序,这是您引用的区别吗? – CCoy