我有一个解析xml文件的转换(下面的例子)并根据该wiki标记生成。 我用于转换的输入xml文件如下所示:
//fileA
<services xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<service>
<name>Service1</name>
<wsdl:operation>A1</wsdl:operation>
</service>
<service>
<name>Service2</name>
<wsdl:operation>A2</wsdl:operation>
</service>
...
<service>
<name>ServiceN</name>
<wsdl:operation>AN</wsdl:operation>
</service>
</services>
我想创建xslt转换来解析保存键值对的其他文件(格式可能不同)
//fileB
<services xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<service>
<name>Service1</name>
<link>http://www.mydomain.com/wsdl/Service1.html</link>
</service>
<service>
<name>Service2</name>
<link>http://www.mydomain.com/wsdl/buy/Service2.html</link>
</service>
...
<service>
<name>ServiceN</name>
<link>http://www.mydomain.com/wsdl/sell/ServiceN.html</link>
</service>
</services>
并将生成xml文件
//fileC
<services xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<service>
<name>Service1</name>
<wsdl:operation>A1</wsdl:operation>
<link>http://www.mydomain.com/wsdl/Service1.html</link>
</service>
<service>
<name>Service2</name>
<wsdl:operation>A2</wsdl:operation>
<link>http://www.mydomain.com/wsdl/buy/Service2.html</link>
</service>
...
<service>
<name>ServiceN</name>
<wsdl:operation>AN</wsdl:operation>
<link>http://www.mydomain.com/wsdl/sell/ServiceN.html</link>
</service>
</services>
有可能吗?我想使用fileB以某种方式将fileA转换为fileC。