ʲôÊÇxml processing instruction(PI)£¿
from:
http://zhidao.baidu.com/question/67891842.html?si=1
ÏÂÃæµÄÒ»ÐоÍÊÇÔÚµÚ¶þ±¾ÊéµÄ¶¨Òå֮ǰµÄ£º
<?page render multiple authors ?>
ËäÈ»Ëü¿´ÉÏÈ¥ºÜÏñXMLÐòÑÔ£¬µ«Êµ¼ÊÉÏÊÇÒ»ÖÖ³ÆΪ´¦ÀíÖ¸Áprocessing instruction£©µÄ²»Í¬ÀàÐ͵ÄÓï·¨¡£´¦ÀíÖ¸ÁÒÔϼò³ÆPI£©µÄÄ¿µÄÊÇΪÁ˸ø´¦ÀíÒ³ÃæµÄ³ÌÐò£¨ÀýÈçXML½âÎöÆ÷£©Ìṩ¶îÍâµÄÐÅÏ¢¡£PIͨ³£Çé¿öÏÂÊÇûÓй̶¨¸ñʽµÄ£¬Î¨Ò»µÄÒªÇóÊǽôËæµÚÒ»¸öÎʺűØÐëÖÁÉÙÓÐÒ»¸ö×Öĸ¡£ÔÚ´ËÖ®ºó£¬PI¿ÉÒÔ°üº¬³ýÁËСÓںźʹóÓÚºÅÖ®ÍâµÄÈκÎ×Ö·û´®ÐòÁС£
×î³£¼ûµÄPIÊÇÓÃÀ´Ö¸¶¨XMLÎļþµÄÑùʽ±í£º
Õâ¸öPIÒ»°ã»áÖ±½Ó·ÅÔÚXMLÐòÑÔÖ®ºó£¬Í¨³£ÓÉWebä¯ÀÀÆ÷ʹÓã¬À´½«XMLÊý¾ÝÒÔÌØÊâµÄÑùʽÏÔʾ³öÀ´¡£
from:
http://e-learning.zjgsu.edu.cn/jdk5doc_zh_CN/org/w3c/dom/ProcessingInstruction.html
org.w3c.dom
½Ó¿Ú ProcessingInstruction
public interface ProcessingInstructionextends Node
ProcessingInstruction ½Ó¿Ú±íʾ“´¦ÀíÖ¸Á¬¸ÃÖ¸Áî×÷ΪһÖÖÔÚÎĵµµÄÎı¾Öб£³ÖÌض¨ÓÚ´¦ÀíÆ÷µÄÐÅÏ¢µÄ·½·¨ÔÚ XML ÖÐʹÓá£
²»¶Ô´¦ÀíÖ¸ÁîµÄÄÚÈݽøÐÐÈκδʻã¼ì²é£¬Òò´ËÔÚ¸ÃÄÚÈÝÖпÉÄÜÓÐ×Ö·ûÐòÁÐ "?>"£¬°´ÕÕ [XML 1.0] µÄ 2.6 ½Ú£¬¸ÃÐòÁÐÊÇ·Ç·¨µÄ¡£³öÏÖ´Ë×Ö·ûÐòÁÐÒ»¶¨»áÔÚÐòÁл¯ÆÚ¼äÉú³ÉÑÏÖØ´íÎó¡£
from:
http://www.javacommerce.com/displaypage.jsp?name=pi.sql&id=18238
Processing Instructions
Processing Instructions are information for the application. PI's allow documents to contain instructions for applications. They are not really of interest to the XML parser. Instead, the instructions are passed to the application using the parser, because the purpose of processing instructions is to represent special instructions for the application.
Like comments, they are not textually part of the XML document.
All processing instructions, including the XML declaration, begin with <? and end with ?>. Following the initial <?, you will find the name of the processing instruction. The PI begins with the PITarget used to identify the application to which the instruction is directed.
<?name pidata?>
<?xml version="1.0"? encoding="UTF-8" standalone="yes"?>
Version Declaration is a form of PI.
Ïà¹ØÎĵµ£º
declare @xml xml
set @xml = '<root/>'
select @xml
declare @value varchar(10)
set @value = 'val1'
set @xml.modify('insert <item value="{sql:variable("@value")}" /> into (/root)[1]')
select @xml
set @value = 'val2'
set @xml.modify('replace value of (/root/item/@value)[1] with "val2 ......
1.½âÊÍ
ÒòΪjspÓõ½ÁËSiteDataÀ࣬¶øSiteData¼Ì³ÐBasePageÀ࣬
ËùÒÔBasePage¹¹Ô캯Êý
BasePage¹¹Ô캯Êý
initializeByCityCodeº¯Êýmain
keyµÄÖµmain.UpImages
vµÄÖµmain.UpImages
2.Ö´ÐÐÍê BasePage.java
ÖеÄinitCommon()ºó£¬
Ìøµ½SiteData.java ÖÐµÄ process();·½·¨£¬
public SiteData(HttpServletR ......
Java codeFormat ft=Format.getRawFormat();
ft.setEncoding("utf-8");
ft.setIndent(" ");//ÉèÖÃËõ½ø
XMLOutputter outputter=new XMLOutputter(ft);//ÉèÖÃXML¸ñʽ
Õâλ˵µÄ²»´í£»
ÔÚieÀïÃ棬ËüÄÜ°Ñxml×Ô¶¯½âÎö³ÆÊ÷Ðνṹ£¬ËùÒÔ¿´ÆðÀ´Ã»ÎÊÌ⣬ÔÚ¼Çʱ¾ÀïÃ棬¾Í²»ÐÐÁ ......
ÔÚ½øÐÐMISϵͳ¿ª·¢¹ý³ÌÖÐ,´ÓÅäÖÃÎļþÖжÁÈ¡ÅäÖÃÐÅÏ¢ÊÇÿһ¸öϵͳ±ØÐë¾ß±¸µÄ¹¦ÄÜ,ÀýÈç,ÎÒÃÇÒªÅäÖöÁÈ¡Êý¾Ý¿âÅäÖÃÐÅÏ¢,°üÀ¨Çý¶¯³ÌÐòÃû¡¢Á¬½Ó×Ö·û´®£¬Óû§Ãû£¬¿ÚÁîµÈÐÅÏ¢£¬ÓÉÓÚÕâЩÐÅÏ¢»áËæ×ÅÓû§µÄ²»Í¬¶ø·¢Éú¸Ä±ä£¬ËùÒÔ²»ÄÜÖ±½Ó°Ñ²ÎÊýдÔÚ³ÌÐòÖУ¬½«ÆäдÈëÅäÖÃÎļþ£¬È»ºóÔÚÓ¦ÓóÌÐòÖжÁÈ¡ÅäÖÃÐÅÏ¢²¢¼ÓÒÔʹÓã¬ÊÇÒ»¸ö³É ......
Ò»¸öXMLÎļþͨ³£°üº¬ÎļþÍ·ºÍÎļþÌåÁ½´ó²¿·Ö
1. ÎļþÍ·
XMLÎļþÍ·ÓÉXMLÉùÃ÷ÓëDTDÎļþÀàÐÍÉùÃ÷×é³É¡£ÆäÖÐDTDÎļþÀàÐÍÉùÃ÷ÊÇ¿ÉÒÔȱÉٵģ¬¹ØÓÚDTDÉùÃ÷½«ÔÚºóÐøµÄÄÚÈÝÖнéÉÜ£¬¶øXMLÉùÃ÷ÊDZØÐëÒªÓеģ¬ÒÔʹÎļþ·ûºÏXMLµÄ±ê×¼¹æ¸ñ¡£
ÔÚÇ°ÃæµÄFlowers.xmlÎļþÖеĵÚÒ»ÐдúÂ뼴ΪXMLÉùÃ÷£º
<?xml °æ ......