100·ÖÇóÖúÈçºÎÓÃjavascriptÓïÑÔ°ÑXMLת»»³ÉJSON
RT ÈçºÎʹÓÃJavaScript°ÑÒ»·Ýxml¸ñʽµÄÎļþÖеÄdata¶Áȡת»»³ÉJSON Êý×é¸ñʽ£¬ÅªºÃµÄÔÚ¼Ó·ÖÊý
XML code:
- <channel>
<title>Key Events from Joe Santoro</title>
- <item>
<title>IMPACT 2010</title>
<events:start>May 02, 2010 12:00 AM</events:start>
<events:end>May 07, 2010 12:00 AM</events:end>
</item>
- <item>
<title>IMPACT 2010</title>
<events:start>May 02, 2010 12:00 AM</events:start>
<events:end>May 07, 2010 12:00 AM</events:end>
</item>
- </channel>
ת»»³ÉÕâÑùµÄ
JScript code:
var json= [{
"title": "IMPACT 2010",
"events_start": "May 02, 2010 12:00 AM",
"events_end": "May 07, 2010 12:00 AM"
},
{
"
"title": "IMPACT 2010",
"events_start": "May 02, 2010 12:00 AM",
"events_end": "May 07, 2010 12:00 AM"
}];
Êä³öµÄ½á¹ûÊÇ:JScript code
Code highlig
Ïà¹ØÎÊ´ð£º
DataSetµ¼³öxml Åú´¦Àí(Ñ»·)µÃÔõô´¦Àí
XMLÎļþ
<A>
<B>
<C>
</C>
&nb ......
´ÓÊý¾Ý¿âÖвéѯһÕűíµÄÊý¾Ý
select ²¿ÃÅ,ÐÕÃû from tb
ÈçºÎ²ÅÄÜÉú³ÉÏÂÃæµÄxml¸ñʽÎļþ
<folder state="unchecked" label="È«²¿">
¡¡¡¡<folder state="unchecked" isBra ......
²úÆ·µÄÅäÖÃÒ³Ãæ¹²ÓÃÒ»¸öÓÃJavaScriptµÄdTreeʵÏÖµÄÊ÷Ðνṹ£¬ÏÔʾµÄʱºò£¬Ê÷Ðνṹ¿¿ÔÚÒ³ÃæµÄ×î×ó±ß£¬¸úÎÒµÄÅäÖÃÒ³ÃæÖмä¸ôÁËÒ»´ó¿é£¬ÏÖÔÚÏë°ÑÊ÷ÐÎĿ¼¾ÓÖУ¬½ô¿¿ÔÚÅäÖÃÄÚÈÝÅԱߣ¬ÈçºÎ¿ØÖÆÊ÷ÐÎĿ¼µÄλÖã¬ÒÔ¼°¿É²»¿ ......
ÎÒÓÐÒ»¸öÀàËÆµÄxmlµÄ string£¬Ïëͨ¹ý±éÀúÔõô¸öxml Êä³öÎÒÏëÒªµÄelementµÄÖµ
xml Ϊ£º
<Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
<RequestType>DISCOVER_XML_ME ......
ÎÒÒªÔÚÍøÒ³ÉÏÉÏ´«Ò»¸öXMLÎļþ£¬ÎÒÔÚC#ÖÐдÁËÒ»¸öÑéÖ¤XMLÎļþ¸ñʽµÄ·½·¨£º
private bool ValidateXml(string xmlFilePath)
{
string xsdPath = Request.PhysicalApp ......