以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 XSL/XSLT/XSL-FO/CSS 』  (http://bbs.xml.org.cn/list.asp?boardid=8)
----  xsl中与javascript的问题  (http://bbs.xml.org.cn/dispbbs.asp?boardid=8&rootid=&id=58567)


--  作者:qqhe325
--  发布时间:1/28/2008 9:16:00 AM

--  xsl中与javascript的问题
xml文件:
<dt_2>
    <id> 120 </id>   
    <NS_editor_id> 111 </NS_editor_id>   
    <NS_content> <DIV   class=Section1   style="LAYOUT-GRID:   15.6pt   none">   <P   class=MsoNormal> <SPAN   lang=EN-US> Fdafa </SPAN> </P>   <P   class=MsoNormal> <SPAN   lang=EN-US> </SPAN> &nbsp; </P>   <P   class=MsoNormal> <SPAN   lang=EN-US> </SPAN> &nbsp; </P>   <P   class=MsoNormal> <B> <I> <SPAN   lang=EN-US> Fasfadsfafafdasfasfa </SPAN> </I> </B> </P>   <P   class=MsoNormal> <SPAN   lang=EN-US> </SPAN> &nbsp; </P>   <P   class=MsoNormal   style="MARGIN-LEFT:   21pt;   TEXT-INDENT:   -21pt"> <SPAN   lang=EN-US   style="BACKGROUND:   yellow;   FONT-FAMILY:   Wingdings"> l <SPAN   style="FONT:   7pt   'Times   New   Roman'"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </SPAN> </SPAN> <SPAN   lang=EN-US   style="BACKGROUND:   yellow"> fasfafadsfdfa </SPAN> </P>   <P   class=MsoNormal> <SPAN   lang=EN-US> </SPAN> &nbsp; </P>   <P   class=MsoNormal> <SPAN   lang=EN-US> </SPAN> &nbsp; </P>   <P   class=MsoNormal> <SPAN   lang=EN-US> </SPAN> &nbsp; </P>   <P   class=MsoNormal> <SPAN   lang=EN-US> <IMG   height=270   src="images/upload/mov.files/image001.jpg"   width=360> </SPAN> </P> </DIV> </NS_content>   
</dt_2>


xsl文件:
    <xsl:when   test="(position()   mod   2)=1"   >
                                                                                        ChangeVedio("upload/clock.avi"," <xsl:value-of   select='NS_title'/> "," <xsl:value-of   select='NS_content'/> ");
    </xsl:when>


问题是:
我在用xsl取得 <NS_content> 中的内容,然后把它传给ChangeVedio()javascript函数,可这么写会报脚本错误,去掉
<xsl:value-of   select='NS_content'/> 是可以的,问题应该就是html中的引号,有单引号和双引号,请大虾指教,谢谢!


--  作者:solidluck
--  发布时间:1/28/2008 9:45:00 AM

--  
关注
--  作者:Qr
--  发布时间:1/28/2008 12:20:00 PM

--  
用xsl:copy-of,具体看手册,或看我的BLOG:http://blogger.org.cn/blog/more.asp?name=Qr&id=26718
--  作者:amani
--  发布时间:1/29/2008 12:06:00 AM

--  
&quot; 代替element 之外的引号 "
--  作者:solidluck
--  发布时间:1/29/2008 9:13:00 AM

--  
<xsl:copy-of />虽然也是向输出流输出,但它包括了所有子代节点。。。不知道楼主用在这里有什么用
--  作者:Qr
--  发布时间:1/29/2008 10:24:00 AM

--  
把大量的HTML代码加入XML不是什么好事。
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
62.500ms