<msg>
I told my son, “You will marry the girl I choose.” He said, “NO!”
I told him, “She is Bill Gates’ daughter.” He said, “OK.”
I called Bill Gates and said, “I want your daughter to marry my son.”
Bill Gates said, “NO.” I told Bill Gates, My son is the CEO of World Bank.” Bill Gates said, “OK.” I called the President of World Bank and asked him to make my son the CEO. He said, “NO.” I told him, “My son is Bill Gates’ son-in-law.” He said, “OK.” This is exactly how politics works . . .
</msg>
我想从第一排从10到20,从第二排从9到19,从第5到第15,从第3排从18到21,我想从第一排到第二排,从第二排到第二排,从第五到第十五,从第三排,从第一排到第一排,从第一排到第一排,从第一排到第十九排,从第二排到第二排,从第五到第十五,从第三排,从第一排到第一排,从第一排到第十九排,从第二排到第二排,从第五到第十五,从第三排到第二排,从18到21,
所以我得到了一些东西
<line1> son, “You </line1>
<line2> im, “She </line2>
<line3> lled Bill Gates d sa</line3>
因此,从10到20之间选择一行字符串,包括类似xsl:)中的空字符串,这是可能的吗?
发布于 2016-09-26 07:30:05
在XSLT2.0中,您可以这样做:
<xsl:template match="msg">
<xsl:variable name="lines" select="tokenize(., ' ')" />
<line1>
<xsl:value-of select="substring($lines[1], 10, 10)" />
</line1>
<line2>
<xsl:value-of select="substring($lines[2], 9, 10)" />
</line2>
<line3>
<xsl:value-of select="substring($lines[3], 5, 10)" />
</line3>
</xsl:template>
https://stackoverflow.com/questions/39706184
复制