1
나는이 입력하는 경우 :XSLT를 사용하여이 하위 요소를 함께 결합하는 방법은 무엇입니까?
<root>
<library id="L1">
<shelf1 id="1">
<book id="1" category="science">
<attributes>
<year>2000</year>
</attributes>
<attributes>
<author>xx</author>
<year>2010</year>
<isbn>001</isbn>
</attributes>
<attributes>
<author>yy</author>
<publisher>zz</publisher>
<isbn>002</isbn>
</attributes>
<other>y</other>
</book>
<book id="2" category="science">
...
</book>
</shelf1>
<shelf2>...</shelf2>
</library>
</root>
expetced 출력 :
<root>
<library id="L1">
<shelf1 id="1">
<book id="1" category="science">
<attributes>
<author>yy</author>
<publisher>zz</publisher>
<isbn>002</isbn>
<year>2010</year>
</attributes>
<other>y</other>
</book>
<book id="2" category="science">
...
</book>
</shelf1>
<shelf2>...</shelf2>
</library>
</root>
내가 함께 요소 '속성'을 결합해야합니다. 두 개 이상의 속성이 존재하는 경우, 이전에 속성의 하위가 존재하지 않았 으면 새 정보로 유지하지만 이전에 존재하면 단순히 최신 값을 사용합니다.
XSLT 1.0 또는 2.0에서 이러한 변환을 수행하는 방법은 도움이됩니다.
존
깔끔하고 멋진 솔루션에 감사드립니다. – John
@ 존, 오신 것을 환영합니다. –