Struts2Êä³öXML¸ñʽµÄResult
À©Õ¹Struts2--×Ô¶¨ÒåStringºÍXML¸ñʽµÄResult
struts2ËäÈ»¼Ì³ÐÁËwebworkÓÅÐãµÄMVC·ÖÀ룬¿ÉÊÇÓÐºÜ¶àµØ·½ÈÃÈ˰Ù˼²»µÃÆä½â£¡×îÈÃÈËÀëÆ×µÄÊÇ£¬·µ»ØµÄ½á¹û¼¯ÖоÓȻûÓÐ
String£¬xmlÕâÁ½Öַdz£³£ÓõÄÀàÐÍ¡£»¹ÊÇ×Ô¼º¶¯ÊÖ£¬·áÒÂ×ãʳ£º
µÚÒ»ÖÖ·½Ê½£ºÊ¹ÓÓPlainText Result”
ÏÈ¿´¹Ù·½Îĵµ¶Ôplain text½á¹ûµÄ¶¨Ò壺“A result that send the content out as
plain text. Usefull typically when needed to display the raw content of
a JSP or Html file for example.”ÕâÊÇÒ»¸ö´¿³¶µ°µÄ˵·¨¡£¡£¡£Ã²ËƸоõÖ»ÄÜ·µ»ØjspÒ³ÃæËÆµÄ£¬×îÆðÂëËûÎóµ¼ÁËÎÒ¡£
ÆäʵʹÓÓPlainText Result” £¬·µ»ØµÄ½á¹ûÊÇδ½øÐиñʽºÍ±àÂ붨ÒåµÄ×Ö·û´®
¡£
ʲôÒâ˼£¿¾ÍÀàËÆÓÚ“FreeMarker Result”
£¬·µ»ØÒ»¸ö*.ftl¸ñʽµÄÄ£°å£¬ÄãÍêÈ«¿ÉÒÔÔÚ*.ftlдstring£¬ÄÇô½á¹û¾ÍÊÇstring£»Ò²¿ÉÒÔÔÚÀïÃæÐ´xml£¬ÄÇô½á¹û¾ÍÊÇxml¡£
¾ÙÀýÈçÏ£º
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<
struts
>
<
package
name
=
"example"
namespace
=
"/example"
extends
=
"struts-default"
>
<
action
name
=
"outputXml"
method
=
"outxml"
class
=
"example.OutputXml"
>
<
result
name
=
"xmlMessage"
type
=
"plaintext"
>
</
result
>
</
action
>
Ïà¹ØÎĵµ£º
ÔÌù: http://topic.csdn.net/u/20100414/11/c69748ac-e0b2-490f-bde9-7c5284c3660c.html?seed=1832202493
declare @xml xml=
'<upd:Update xmlns:lar="http://schemas.microsoft.com/msus/2002/12/LogicalApplicabilityRules" xmlns:cmd="http://schemas.microsoft.com/msus/2002/12/UpdateHandlers/Command ......
ÀûÓÃXPath¶ÁÈ¡XmlÎļþ
Ö®ËùÒÔÒªÒýÈëXPathµÄ¸ÅÄĿµÄ¾ÍÊÇΪÁËÔÚÆ¥ÅäXMLÎĵµ½á¹¹Ê÷ʱÄܹ»×¼È·µØÕÒµ½Ä³Ò»¸ö½ÚµãÔªËØ¡£¿ÉÒÔ°ÑXPath±È×÷Îļþ¹ÜÀí·¾¶£ºÍ¨¹ýÎļþ¹ÜÀí·¾¶£¬¿ÉÒÔ°´ÕÕÒ»¶¨µÄ¹æÔò²éÕÒµ½ËùÐèÒªµÄÎļþ£»Í¬Ñù£¬ÒÀ¾ÝXPathËùÖÆ¶¨µÄ¹æÔò£¬Ò²¿ÉÒԺܷ½±ãµØÕÒµ½XML½á¹¹ÎĵµÊ÷ÖеÄÈκÎÒ»¸ö½Úµã.
¡¡¡¡²»¹ý£¬ÓÉÓÚXPath¿ÉÓ¦Ó ......
/// <summary>
/// ÊÕµ½µÄXMLת³ÉdatasetÐÍ
/// </summary>
/// <param name="xmlData"></param>
/// ......
Èý¡¢ÑµÁ··ÖÀàÆ÷
Ñù±¾´´½¨Ö®ºó£¬½ÓÏÂÀ´ÒªÑµÁ··ÖÀàÆ÷£¬Õâ¸ö¹ý³ÌÊÇÓÉhaartraining ³ÌÐòÀ´ÊµÏֵġ£
Haartraining µÄÃüÁîÐвÎÊýÈçÏ£º
£data<dir_name>
´æ·ÅѵÁ·ºÃµÄ·ÖÀàÆ÷µÄ·¾¶Ãû¡£
£vec<vec_file_name>
ÕýÑù±¾ÎļþÃû£¨ÓÉtrainingssamples ³ÌÐò»òÕßÓÉÆäËûµÄ·½·¨´´½¨µÄ£©
£bg<background_file_name& ......