【发布时间】:2016-10-21 01:55:19
【问题描述】:
目前我正在研究这个 xlst 并执行以下操作:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/eventos">
<html>
<body>
{
<br/>
"fecha": "<xsl:value-of select="fecha"/>",
<br/>
eventos: [{
<xsl:for-each select="evento">
"evento":{
"titulo" : "<xsl:value-of select="titulo"/>",<br/>
"descripcion" : "<xsl:value-of select="descripcion"/>",<br/>
"lugar" : {
<xsl:element name="lugar"/>
"nombre" : "<xsl:value-of select="nombre"/>"
}
"hora" : "<xsl:value-of select="hora"/>",},
<br/>
</xsl:for-each>
}]
}
</body>
</html>
</xsl:template>
</xsl:stylesheet>
但是,我似乎无法正确设置间距:
如何缩进元素?
有没有办法在不使用
br标签的情况下获得换行符?目前,当我在浏览器上按 F12 时,我看到了换行符,而我希望整个文档合为一体(标记?)。
谢谢!
【问题讨论】:
-
你能添加你的输入吗