使用xsl创建段落
嘿,如果有人对如何从XML文件中获取新行并将它们转换为带有XSL转换的段落有任何建议,我就会徘徊。
这是XML结构的样子:
<?xml version="1.0" encoding="ISO-8859-1"?>
<document>
<book>
<issue>1</issue>
<body>
“Dude, I can't believe you fed it to your cat. That's crazy!”
“Yeah, dude, he just cuddled up next to me and started purring.”
“Then what did he do?”
“He just kept purring, man. He's been purring non-stop for like two weeks now. I can't even sleep.”
</body>
</book>
</document>
这里是我用于转换的XSL表的副本。
<?xml version="1.0" encoding="ISO-8859-1"?>
<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
<body style="font-family:Arial;font-size:12pt;">
<xsl:for-each select="document/book">
<div style="color:red; padding:4px;">
<span style="font-weight:bold">
</span> Chapter
<xsl:value-of select="info/issue"/>
</div>
<div style="margin-left:10px; margin-bottom:1em; margin-right:25px; font-size:10pt;">
<span>
<xsl:value-of select="body"/>
</span>
</div>
</xsl:for-each>
</body>
</html>
同样,我的问题涉及使用现有XSL文档保留段落结构的命令。
谢谢,
Ë
没有找到相关结果
已邀请:
2 个回复
死狸蔽垂藐
当应用于提供的XML文档时:
产生想要的,正确的结果:
说明:标识规则+一个递归命名模板,用于包装到由NL字符包围的每个文本子字符串。
款去芳尾脊