我想从我的 xml 文件中删除不必要的属性。我知道我们可以通过 xsl 删除。但我不知道该怎么做。我在互联网上搜索我无法得到预期的结果。
这是当前我的 xml 输出
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<rsm:Invoice xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:rsm="http://www.ita.org/"
xmlns:ccts="urn:un:unece:uncefact:documentation:standard:CoreComponentsTechnicalSpecification:2"
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:2"
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:2"
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ita.org/ Invoice_20.xsd">
<rsm:HeaderExchangedDocument>
<ram:ID xmlns:ram="http://www.ita.org/">103004</ram:ID>
<ram:TypeCode xmlns:ram="http://www.ita.org/">Invoice</ram:TypeCode>
<ram:IssueDateTime xmlns:ram="http://www.ita.org/">2014-01-01</ram:IssueDateTime>
<ram:CopyIndicator xmlns:ram="http://www.ita.org/">Original</ram:CopyIndicator>
<ram:CustomsID xmlns:ram="http://www.ita.org/" />
<ram:HeaderInformation xmlns:ram="http://www.ita.org/" />
<ram:SummaryInformation xmlns:ram="http://www.ita.org/" />
</rsm:HeaderExchangedDocument>
<rsm:SpecifiedLogisticsConsignment>
<ram:IncludedSupplyChainConsignment xmlns:ram="http://www.ita.org/">
<ram:BorderCrossingLogisticsTransportMovement>
<ram:ModeCode>1</ram:ModeCode>
<ram:Mode>Sea</ram:Mode>
<ram:ID />
</ram:BorderCrossingLogisticsTransportMovement>
</ram:IncludedSupplyChainConsignment>
</rsm:SpecifiedLogisticsConsignment>
</rsm:Invoice>
我想得到以下格式
<?xml version="1.0" encoding="UTF-8"?>
<rsm:Invoice xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:rsm="http://www.ita.org/"
xmlns:ccts="urn:un:unece:uncefact:documentation:standard:TechnicalSpecification:2"
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:2"
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:2"
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ita.org/ Invoice_20.xsd">
<rsm:HeaderExchangedDocument>
<ram:ID>103004</ram:ID>
<ram:TypeCode>Invoice</ram:TypeCode>
<ram:IssueDateTime>2014-01-01</ram:IssueDateTime>
<ram:CopyIndicator>Original</ram:CopyIndicator>
<ram:CustomsID/>
<ram:HeaderInformation/>
<ram:SummaryInformation/>
</rsm:HeaderExchangedDocument>
<rsm:SpecifiedLogisticsConsignment>
<ram:IncludedSupplyChainConsignment>
<ram:BorderCrossingLogisticsTransportMovement>
<ram:ModeCode>1</ram:ModeCode>
<ram:Mode>Sea</ram:Mode>
<ram:ID />
</ram:BorderCrossingLogisticsTransportMovement>
</ram:IncludedSupplyChainConsignment>
</rsm:SpecifiedLogisticsConsignment>
</rsm:Invoice>
我可以在 xslt 中做什么?