谁能介绍一下xsp?

chl 2002-04-26 02:12:59

为什么要用xsp?有什么好处?给个例子看看。
...全文
172 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
kkhui 2002-04-26
  • 打赏
  • 举报
回复
xml.apache.org/cocoon
oliff 2002-04-26
  • 打赏
  • 举报
回复
XSP provides the front-end portion of an XML framework. Providing dynamic XML pages that are parsed and transformed by the framework allows application interoperability, yet the pages are constructed and stored as static files on a file system.

An XSP page is an XML page with the following requirements:

It must have a cocoon processing instruction that invokes the XSP processor <?cocoon-process type="xsp"?>

The document root element must be <xsp:page>

It must also have any language and Taglib declarations as attributes in the <xsp:page> tag (e.g. <xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">

In order for the XSP page to be useful, it will also require usually at least an <xsp:logic> element and an <xsp:expr> element.


So, here is a minimal XSP page:

<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="page-html.xsl" type="text/xsl"?>

<xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
<xsp:logic>
static private int counter = 0;

private synchronized int count() {
return counter++;
}
</xsp:logic>

<page>
<p>I've been requested <xsp:expr>count()</xsp:expr> times.</p>
</page>
</xsp:page>

8,909

社区成员

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

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