xml文档在浏览器中显示有关问题
xml文档在浏览器中显示问题
xml文档
xsl文档
为什么会这样显示,求解!!

------解决方案--------------------
你解析后是text文本格式,浏览器是按html显示的(例如文本换行在html不起效,要用<br />标签),所以期望工整显示就要解析为html格式
xml文档
<?xml version="1.0" encoding="GB2312"?>
<?xml-stylesheet type="text/xsl" href="book.xsl"?>
<book><title>XML and JSP</title>
<chapter><title>第1章 认识XML与DTD</title>
<!--第1章第1节-->
<section><title>XML的产生</title>
<example>HelloWorld.html</example>
</section>
</chapter>
<chapter><title>第2章 XML名称空间</title>
<!--第2章第1节-->
<section><title>名称空间在元素和属性中的应用</title>
<!--第2章第1节的第1节-->
<section><title>名称空间在元素中应用</title>
<example>people.xml</example>
</section>
<!--第2章第1节的第2节-->
<section><title>默认名称空间</title>
<example>book.xml</example>
</section>
<section><title>名称空间在属性中的应用</title>
<example>book2.xml</example>
</section>
</section>
<section><title>名称空间和DTD</title></section>
</chapter>
</book>
xsl文档
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="section">
<xsl:number format="1. " level="multiple"/>
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
为什么会这样显示,求解!!
xml
xsl
浏览器
------解决方案--------------------
你解析后是text文本格式,浏览器是按html显示的(例如文本换行在html不起效,要用<br />标签),所以期望工整显示就要解析为html格式