100分求两个Xsl+Xml做网页所遇问题的解!在线等。

mfkiqpl 2005-06-14 08:04:05
问题一:
用XSL把XML文件格式化成有版排的页面时。。
Xml里一元素(如:文章)的值包含 换行、回车等内容(即一遍带段落的文章)。
如何用xsl取值时还保持段落不变。。
说明:我没有用到动态脚本技术。如:ASP等。。
像本论坛是用的textbox来实现的。。有没有其它方法。。我不想用textbox

问题二:
和上一问题有相似。
如果在这遍文章内包含图片,又怎么写xml和xsl。我不想重加一元素来指明图片地址。。因为图片会可能出现在文章的任何地方。。

请各位帮帮小弟。。感激不尽。。
...全文
138 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
→黑白灰← 2005-06-15
  • 打赏
  • 举报
回复
我的解决方法

xml文件中排版好的内容,HTML格式:
<Content><![CDATA[这里是HTML格式的内容]]></Content>

xsl文件中:
开头有一句<xsl:output method="html" />
一般好像method是用的text
然后用<xsl:value-of disable-output-escaping="yes" select="NewsInfo/Content" />显示文章内容


来自http://www.zvon.org/的介绍
Attribute: method (of element <output>)
Standard excerpt:
The method attribute on xsl:output identifies the overall method that should be used for outputting the result tree. The value must be a QName. If the QName does not have a prefix, then it identifies a method specified in this document and must be one of xml, html or text. If the QName has a prefix, then the QName is expanded into an expanded-name; the expanded-name identifies the output method
mfkiqpl 2005-06-15
  • 打赏
  • 举报
回复
感谢。。楼上的。。
mfkiqpl 2005-06-14
  • 打赏
  • 举报
回复
在线等呀。。还没有好的方法。。谁能帮帮我。。

回楼上的。。
就算我在内容中加上<br/><p/>他也不会有段落。。。
HLis 2005-06-14
  • 打赏
  • 举报
回复
这样做就太麻烦了,你为什么不在文章数据中就表明段落和行呢?这样很好啊。就是说你在输入这篇文章的时候输入成这个样子
<文章>
<段落>
...<回车/>...
</段落>
...
</文章>
新鲜鱼排 2005-06-14
  • 打赏
  • 举报
回复
up
_NET2004 2005-06-14
  • 打赏
  • 举报
回复
读取XML文件我也在想办法

8,909

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧