자식 노드를 기준으로 부모 노드를 제거하는 방법에 대한 질문이 있습니다. XML 파일의 구조 다음있다XSL : 중복 자식이있는 부모 노드 제거
:
<PlmXmlData xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:plm="http://www.plmxml.org/Schemas/PLMXMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:an="">
<ItemList>
<Item>
<ID>1</ID>
<Group>Group1</Group>
<Projekt>Projekt1</Projekt>
<DatasetList>
<Dataset>
<Name>Name1</Name>
<Type>TXT</Type>
<Template>None</Template>
<RelativeFilePath>FilePath1</RelativeFilePath>
<PropertyList>
<Property>
<Title>item_name</Title>
<Value>ITEM_Name</Value>
</Property>
<Property>
<Title>item_name</Title>
<Value>ITEM_Name</Value>
</Property>
</PropertyList>
</Dataset>
<Dataset>
<Name>Name1</Name>
<Type>PDF</Type>
<Template>Template1</Template>
<RelativeFilePath>FilePath1/Name1.pdf</RelativeFilePath>
<PropertyList>
<Property>
<Title>item_name</Title>
<Value>CAR1</Value>
</Property>
<Property>
<Title>item_name</Title>
<Value>CAR1</Value>
</Property>
<Property>
<Title>item_name2</Title>
<Value>CAR2</Value>
</Property>
<Property>
<Title>item_name2</Title>
<Value>CAR2</Value>
</Property>
</PropertyList>
</Dataset>
</DatasetList>
</Item>
</ItemList>
</PlmXmlData>
이 예를 들어, TXT 및 PDF 다른 <Type>
노드가 볼 수 있듯이. 이 노드에는 노드 <Property>
과 자식 노드 <Title>
및 <Value>
이 있습니다.
노드 <Title>
및 <Value>
을 각각 <Type>
에있는 각 중복 항목에 대해 전체 노드 <Property>
을 제거하고 싶습니다.
원하는 출력은 다음과 같이해야한다 : 나는이 포럼을 검색하지만, 피팅 해결책을 찾기 could'nt 한
<PlmXmlData xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:plm="http://www.plmxml.org/Schemas/PLMXMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:an="">
<ItemList>
<Item>
<ID>1</ID>
<Group>Group1</Group>
<Projekt>Projekt1</Projekt>
<DatasetList>
<Dataset>
<Name>Name1</Name>
<Type>TXT</Type>
<Template>None</Template>
<RelativeFilePath>FilePath1</RelativeFilePath>
<PropertyList>
<Property>
<Title>item_name</Title>
<Value>ITEM_Name</Value>
</Property>
</PropertyList>
</Dataset>
<Dataset>
<Name>Name1</Name>
<Type>PDF</Type>
<Template>Template1</Template>
<RelativeFilePath>FilePath1/Name1.pdf</RelativeFilePath>
<PropertyList>
<Property>
<Title>item_name</Title>
<Value>CAR1</Value>
</Property>
<Property>
<Title>item_name2</Title>
<Value>CAR2</Value>
</Property>
</PropertyList>
</Dataset>
</DatasetList>
</Item>
</ItemList>
. 사전에 도와 주셔서 감사합니다!
XSLT 1.0 또는 XSLT 2.0 중 하나를 선택하십시오. 둘 다 선택하지 마십시오. 중복을 제거하려면 * grouping * 검색을 수행하십시오. 아마도 여기에서 가장 자주 묻는 XSLT 질문 일 것입니다. –