以文本方式查看主题 - 计算机科学论坛 (http://bbs.xml.org.cn/index.asp) -- 『 XSL/XSLT/XSL-FO/CSS 』 (http://bbs.xml.org.cn/list.asp?boardid=8) ---- 求助,xml里面的<br/>能在输出后换行么? (http://bbs.xml.org.cn/dispbbs.asp?boardid=8&rootid=&id=13858) |
-- 作者:菜籽 -- 发布时间:1/20/2005 12:22:00 PM -- 求助,xml里面的<br/>能在输出后换行么? 我的xml文件中有<br/>字符,我想用xslt转换后能够换行,不知能不能实现,请高手指点!谢谢 <TextBlock><![CDATA[下面程序的运行结果是 <br />char c[5] ={‘a’,’b’,’\0’,’\c’,’\0’}; <br />printf(“%s”,c); <br /> |
-- 作者:hyl_fr -- 发布时间:1/20/2005 12:53:00 PM -- 是<br/>吧,中间没有空格吧 |
-- 作者:菜籽 -- 发布时间:1/20/2005 1:12:00 PM -- 有没有好像不影响啊 |
-- 作者:sam -- 发布时间:1/20/2005 1:24:00 PM -- <xsl:value-of select="TextBlock" disable-output-escaping="yes"/> |
-- 作者:菜籽 -- 发布时间:1/20/2005 1:43:00 PM -- 谢谢sam大哥,谢谢 |
-- 作者:菜籽 -- 发布时间:1/20/2005 2:01:00 PM -- 一个简单的文件可以啊: 1.xml <?xml version="1.0" encoding="GBK"?> <?xml-stylesheet type="text/xsl" href="1.xsl"?> <TextBlock> <![CDATA[下面程序的运行结果是 <br />char c[5] ={‘a’,’b’,’\0’,’\c’,’\0’}; <br />printf(“%s”,c); <br />]]> </TextBlock> 1.xsl <?xml version="1.0" encoding="gb2312"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
-- 作者:菜籽 -- 发布时间:1/20/2005 2:02:00 PM -- xml文件:TestAll.xml <?xml version="1.0" encoding="GBK"?> <?xml-stylesheet type="text/xsl" href="TestAll.xsl"?> <TestPaper> <Choice> <Question NO="1" ID="001" ZTMXH="0" KMDM="CCSJ0" TMLX="XZ0"> <QuestionPart XH="1"> <TextBlock><![CDATA[下面程序的运行结果是 <br />char c[5] ={‘a’,’b’,’\0’,’\c’,’\0’}; <br />printf(“%s”,c); <br /> ]]></TextBlock> </QuestionPart> <AnswerPart XH="2" b_zqda="false" b_yc="false"> <TextBlock><![CDATA[1.1.1 ]]></TextBlock> </AnswerPart> <AnswerPart XH="3" b_zqda="false" b_yc="false"> <TextBlock><![CDATA[1.1.2 ]]></TextBlock> </AnswerPart> <AnswerPart XH="4" b_zqda="false" b_yc="false"> <TextBlock><![CDATA[11答案3文本 ]]></TextBlock> </AnswerPart> <AnswerPart XH="5" b_zqda="true" b_yc="false"> <TextBlock><![CDATA[11答案4<br />文本 ]]></TextBlock> </AnswerPart> </Question > <Question NO="2" ID="002" ZTMXH="0" KMDM="CCSJ0" TMLX="XZ0"> <QuestionPart XH="1"> <TextBlock><![CDATA[题干文本*a>&b,c<d,e>f,<@#%%^&&**)()(*&^%$#]]></TextBlock> </QuestionPart> <AnswerPart XH="2" b_zqda="false" b_yc="false"> <TextBlock><![CDATA[ 缩短发22答案1文本 ]]></TextBlock> </AnswerPart> <AnswerPart XH="3" b_zqda="false" b_yc="false"> <TextBlock><![CDATA[讯22答案2文本 ]]></TextBlock> </AnswerPart> <AnswerPart XH="4" b_zqda="false" b_yc="false"> <TextBlock><![CDATA[选择22答案3文本 ]]></TextBlock> </AnswerPart> <AnswerPart XH="5" b_zqda="true" b_yc="false"> <TextBlock><![CDATA[1.2.4 ]]></TextBlock> </AnswerPart> </Question> </Choice> <Blank> <Question NO="1" ID="001" ZTMXH="0" KMDM="CCSJ0" TMLX="XZ0"> <QuestionPart XH="1"> <TextBlock><![CDATA[填空题的题干1]]></TextBlock> </QuestionPart> <AnswerPart XH="2" b_zqda="false" b_yc="false"> <TextBlock><![CDATA[2.1.1 ]]></TextBlock> </AnswerPart> </Question> <Question NO="2" ID="001" ZTMXH="0" KMDM="CCSJ0" TMLX="XZ0"> <QuestionPart> <TextBlock><![CDATA[第2题填空题的题干2]]></TextBlock> </QuestionPart> <AnswerPart XH="2" b_zqda="false" b_yc="true"> <TextBlock><![CDATA[填空答案1文本 ]]></TextBlock> </AnswerPart> <AnswerPart XH="3" b_zqda="false" b_yc="true"> <TextBlock><![CDATA[2.2.2 ]]></TextBlock> </AnswerPart> </Question> </Blank> </TestPaper>
|
-- 作者:菜籽 -- 发布时间:1/20/2005 2:02:00 PM -- xsl文件:TestAll.xsl <?xml version="1.0" encoding="gb2312"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="TestPaper"> <xsl:template match="Choice"> <xsl:template match="Blank"> <xsl:for-each select="AnswerPart"> <xsl:template match="Question"> <xsl:template match="QuestionPart"> <xsl:template match="AnswerPart"> 输出结果中产生<br/>不换行啊,再次麻烦sam大哥帮忙啊
|
W 3 C h i n a ( since 2003 ) 旗 下 站 点 苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》 |
7,828.125ms |