<?xml version="1.0" encoding="UTF-8"?>
<root>
<sentence>
<word1>The</word1>
<word2>cat</word2>
<word3>sat</word3>
<word4>on</word4>
<word5>the</word5>
<word6>mat</word6>
</sentence>
<sentence>
<word1>The</word1>
<word2>quick</word2>
<word3>brown</word3>
<word4>fox</word4>
<word5>did</word5>
<word6>nothing</word6>
</sentence>
</root>
내가 무엇을 할 수 있기를 원하는 것은 과정이이 ~ 고양이처럼, 문장을 만들 XSLT 함께 ~ ~ ~ ~ ~ mat ~
(이것은 내가 궁극적으로 할 수있는 일의 단순한 예이며, 지금은 단지 걸림돌입니다.)
내 XSLT는 다음과 같습니다. 나는 XML을 통해 스타일 시트를 실행하는 경우는 다음 줄에 자신의 다음, 틸다를 s로 나는 tildas I를 제거하면
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="no" />
<xsl:template match="text()[not(string-length(normalize-space()))]"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<xsl:text>
</xsl:text>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="/root/sentence">
<xsl:apply-templates />
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="word1">
<xsl:value-of select="text()" />
~
</xsl:template>
<xsl:template match="word2">
<xsl:value-of select="text()" />
~
</xsl:template>
<xsl:template match="word3">
<xsl:value-of select="text()" />
~
</xsl:template>
<xsl:template match="word4">
<xsl:value-of select="text()" />
~
</xsl:template>
<xsl:template match="word5">
<xsl:value-of select="text()" />
~
</xsl:template>
<xsl:template match="word6">
<xsl:value-of select="text()" />
~
</xsl:template>
</xsl:stylesheet>
나는이
<?xml version="1.0" encoding="UTF-8"?>
The
~
cat
~
sat
~
on
~
the
~
mat
~
The
~
quick
~
brown
~
fox
~
did
~
nothing
~
같은 라인의 각 단어를 얻을 의 새로운 라인에 틸다의 포함은 새로운 라인을 강요하고 있다고, 그런 다음 나에게 보이는
Thecatsatonthemat
수 (나는이 XSLT 물건에 새로운 오전).
그래서 템플릿의 출력을 모두 한 줄로 만들 수 있습니까? (필자의 마지막 요구 사항은 엘리먼트에 더 많은 포맷팅을하고, 엘리먼트를 패딩하기위한 공간이다 - 나중에 설명하겠다.) 기대에
감사
확실히 트릭을 수행했습니다. 감사합니다 – Nerdio