以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 XSL/XSLT/XSL-FO/CSS 』  (http://bbs.xml.org.cn/list.asp?boardid=8)
----  小的不才,有事请教  (http://bbs.xml.org.cn/dispbbs.asp?boardid=8&rootid=&id=13195)


--  作者:nhlsm
--  发布时间:1/1/2005 2:31:00 PM

--  小的不才,有事请教
小的不才,有事请教!
下面是我的XML文档和XSL文档,但是在转化"处理指令"时报错.出现:预期的句柄 'eof' 找到 '('。 /-->(<--pi()).这样的提示.
请问问题出现在哪?谢谢各位!!!

<!--xml文档-->
<?xml version="1.0" encoding="gb2312"?>
<?xml:stylesheet type='text/xsl' href='p217.xsl'?>
<film>
<!--目前只有VCD版,DVD版还未上市-->
<name>拯救大兵瑞恩</name>
<director>斯尔伯格</director>
</film>

<!--XSL文档-->
<?xml version="1.0" encoding="gb2312" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates select="/(pi())"/>
  <xsl:apply-templates select="//comment()"/><br/>
  <xsl:value-of select="//name"/><br/>
  <xsl:value-of select="//director"/><br/>
</xsl:template>
<xsl:template match="//comment()">

   <xsl:value-of select="."/>

</xsl:template>
<xsl:template match="/(pi())">
<xsl:pi name='xml-stylesheet'>
<xsl:value-of select="."/>
</xsl:pi>
</xsl:template>
</xsl:stylesheet>


--  作者:doubleG
--  发布时间:1/3/2005 2:40:00 PM

--  
<xsl:apply-templates select="/(pi())"/>
??????
--  作者:菜籽
--  发布时间:1/16/2005 12:26:00 PM

--  
1.xml

<?xml version="1.0" encoding="gb2312"?>
<?xml:stylesheet type="text/xsl" href="1.xsl"?>
<film>
<!--目前只有VCD版,DVD版还未上市-->
<name>拯救大兵瑞恩</name>
<director>斯尔伯格</director>
</film>


1.xsl

<?xml version="1.0" encoding="gb2312" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <xsl:apply-templates select="//comment()"/><br/>
  <xsl:value-of select="//name"/><br/>
  <xsl:value-of select="//director"/><br/>
</xsl:template>

<xsl:template match="//comment()">
   <xsl:value-of select="."/>
</xsl:template>

</xsl:stylesheet>


不知是不是你需要的


--  作者:sam
--  发布时间:1/20/2005 2:13:00 PM

--  
<?xml version="1.0" encoding="gb2312" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates select="//processing-instruction()"/>
  <xsl:apply-templates select="//comment()"/><br/>
  <xsl:value-of select="//name"/><br/>
  <xsl:value-of select="//director"/><br/>
</xsl:template>
<xsl:template match="//comment()">

   <xsl:value-of select="."/>

</xsl:template>
<xsl:template match="//processing-instruction()">
<xsl:processing-instruction name='xml-stylesheet'>
<xsl:value-of select="."/>
</xsl:processing-instruction>
</xsl:template>
</xsl:stylesheet>


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
46.875ms