1
다른 사람의 문제를 해결하려고 시도했지만 그 대신 내 자신의 이상한 문제가 발생했다는 것이 확실합니다. 그러나 아직 답은 간단합니다.XSLT 요소 정렬에서 출력
는 XML 내가 가진 :
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="info">
<xsl:copy>
<xsl:element name="content">
<xsl:for-each select="content">
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="node()"/>
</xsl:for-each>
</xsl:element>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
이 (가) 작성 :
XSLT와<xml>
<head>
<info>
<content>
<source attribute1="RSC1985s5c1" attribute2="6(17)">
data1
</source>
<cite/>
<case/>
(
<target attribute1="LRC1985s5c1" attribute2="6(17)1">
3e/191
</target>
)
</content>
<content>
<source attribute1="RSC1985s5c1" attribute2="6(17)">
data2
</source>
<cite/>
<case/>
(
<target attribute1="LRC1985s5c4" attribute2="6(17)1">
4e/54
</target>
)
</content>
</info>
</head>
</xml>
는이 개 내용 요소를 결합하는
는<?xml version="1.0" encoding="utf-8"?><xml> //Just noticed here too!
<head>
<info><content> //Why no new line here?
<source attribute1="RSC1985s5c1" attribute2="6(17)">
data1
</source>
<cite />
<case />
(
<target attribute1="LRC1985s5c1" attribute2="6(17)1">
3e/191
</target>
)
<source attribute1="RSC1985s5c1" attribute2="6(17)">
data2
</source>
<cite />
<case />
(
<target attribute1="LRC1985s5c4" attribute2="6(17)1">
4e/54
</target>
)
</content></info> //And again here?
</head>
</xml>
주석을 사용하여 강조 표시된 문제는 무엇입니까 I 알아낼 수없는 이유는 요소 사이에 새로운 라인이 없다는 것입니다.
미리 감사드립니다. 제공된 변형으로
원하는대로 작동하지만 내 프로세서는 빈 요소의 들여 쓰기를 약간 다르게 처리하지만 Microsoft는 그 작업을 약간 다릅니다. 평소와 같이 신속하고 완벽한 답변을드립니다! – Mike
@ 마이크 : 천만에. –