【发布时间】:2010-12-01 09:41:47
【问题描述】:
我对 XSLT 完全陌生,需要一些帮助来解决我的一个问题。我想要完成的是:
我有一个看起来像这样的文件:
<Transaction>
<Date>2010-10-14T12:06:12.164+01:00</Date>
<Production>NO</Production>
<Document fun:OID="1.9.101106">
<DocumentType xmlns="">Monthly A</DocumentType>
<RangeName xmlns="">Range Name</RangeName>
<Name xmlns="">Equity</Name>
<Language xmlns="">English</Language>
<Class xmlns="">A Acc</Class>
<Active xmlns="">YES</Active>
<Country xmlns="">UK</Country>
<Country xmlns="">Luxembourg</Country>
<Country xmlns="">Denmark</Country>
<Country xmlns="">Malta</Country>
<Primary fun1:OID="1.9.101106" xmlns="" xmlns:fun1="DocumentXML.com">
<Name>SISF-Indian-Equity-A-Acc-FMR-UKEN</Name>
<FileSizeInKB>176784</FileSizeInKB>
<FileType>pdf</FileType>
<ReportingPeriod>September</ReportingPeriod>
<ReportingYear>2010</ReportingYear>
</Primary>
<Primary fun1:OID="1.9.101118" xmlns="" xmlns:fun1="DocumentXML.com">
<Name>SISF-Indian-Equity-A-Acc</Name>
<FileSizeInKB>176784</FileSizeInKB>
<FileType>pdf</FileType>
<ReportingPeriod>September</ReportingPeriod>
<ReportingYear>2010</ReportingYear>
</Primary>
</Document>
</Transaction>
我想保留当前文件,除了我想将国家节点复制到主节点中。所以它看起来像这样:
<Transaction>
<Date>2010-10-14T12:06:12.164+01:00</Date>
<Production>NO</Production>
<Document fun:OID="1.9.101106">
<DocumentType xmlns="">Monthly A</DocumentType>
<RangeName xmlns="">Range Name</RangeName>
<Name xmlns="">Equity</Name>
<Language xmlns="">English</Language>
<Class xmlns="">A Acc</Class>
<Active xmlns="">YES</Active>
<Country xmlns="">UK</Country>
<Country xmlns="">Luxembourg</Country>
<Country xmlns="">Denmark</Country>
<Country xmlns="">Malta</Country>
<Primary fun1:OID="1.9.101106" xmlns="" xmlns:fun1="DocumentXML.com">
<Name>SISF-Indian-Equity-A-Acc-FMR-UKEN</Name>
<FileSizeInKB>176784</FileSizeInKB>
<FileType>pdf</FileType>
<ReportingPeriod>September</ReportingPeriod>
<ReportingYear>2010</ReportingYear>
<Country xmlns="">UK</Country>
<Country xmlns="">Luxembourg</Country>
<Country xmlns="">Denmark</Country>
<Country xmlns="">Malta</Country>
</Primary>
<Primary fun1:OID="1.9.101118" xmlns="" xmlns:fun1="DocumentXML.com">
<Name>SISF-Indian-Equity-A-Acc</Name>
<FileSizeInKB>176784</FileSizeInKB>
<FileType>pdf</FileType>
<ReportingPeriod>September</ReportingPeriod>
<ReportingYear>2010</ReportingYear>
<Country xmlns="">UK</Country>
<Country xmlns="">Luxembourg</Country>
<Country xmlns="">Denmark</Country>
<Country xmlns="">Malta</Country>
</Primary>
</Document>
</Transaction>
实现这一目标的最佳方法是什么?我是否需要先复制整个文件,然后再复制各个国家/地区,还是可以以某种方式一次性完成?
【问题讨论】: