处理指令的应用

其中,proc是目标(target),****是文本.
这我看的不太懂啊,proc是怎么定的?是随便自己定义的还是规定引用的,如果是自己定义的,那他要执行的程序怎么定义?放在什么地方?是XML里面还是XML文件外面?****是怎么写的?能不能给个简单的例子?
---------------------------------------------------------------

they are application specific, the application processing the xml file needs to understand them/process them or simply ignore them

for example, you have an applications which process xml files, in the input xml file, you specify

if the application understand this and it can change SomeTag to SomeTag2, if the application does not understand this processing instruction, it will igore it
---------------------------------------------------------------

处理指令是和处理程序相关的,不过也有大家约定俗成的,比如

。 \--------------------------------------------------------------- 怎么说不明白呀! 我举个例子,JSP里面本来没有

指令,但是Resin这个JSP/Servlet engine加入了这个指令,所以在Resin的JSP里,你可以给一个JSP文件设定一个样式表。这是一个额外的很有用的功能。

那么如何实现样式表的功能呢?你就去看Resin的源代码好了,因为它是一个开源的项目。

无论如何,要我们猜测的话,其大体步骤不外乎如下:
1. 解析该JSP文件,转换成xml dom树;
2. 获得

指令中所设置的样式表参数;
3. 读取该参数对应的样式表文件,并应用到JSP上生成结果树;
4. 将结果树发给下一个处理程序(例如JSP转换成Servlet的程序)。

Published At
Categories with Web编程
Tagged with
comments powered by Disqus