ÄÄλ¸ßÊÖ»áXML?Çë½ÌXDRÑéÖ¤XMLÎÊÌâ
ÕâÊÇÑéÖ¤´úÂë
<%@page language="vb"%>
<%@import namespace="system.xml"%>
<%@import namespace="system.xml.schema"%>
<script runat="server">
dim xtr as xmltextreader
dim xvr as xmlvalidatingreader
sub page_load(ob as object,ev as eventargs)
try
xtr= new xmltextreader(server.mappath("xml.xml"))
xvr=new xmlvalidatingreader(xtr)
xvr.validationtype=validationtype.schema
addhandler xvr.validationeventhandler,addressof showerror
while xvr.read
end while
catch ex as exception
response.write("error accessing xml file")
finally
xtr.close
xvr.close
end try
end sub
sub showerror(ob as object,ev as validationeventargs)
response.write(" <font color='red'>" & ev.message & " </font> <br>")
response.write("line:" & xtr.linenumber & "position:" & xtr.lineposition)
end sub
</script>
<html>
<body>
</body>
</html>
xmlschema.xdrģʽÎļþÄÚÈÝ
<?xml version="1.0"?>
&
Ïà¹ØÎÊ´ð£º
Êý¾Ý¿â±íÖÐÓÐÒ»ÁУ¨TranXml£©ÀàÐÍÊÇxml£¬´æ´¢µÄÊÇÀàËÆ
<fathernode>
<a>aaa
</a>
<b>bbb
</b>
</fathernode>
µÄÐÅÏ¢£¬²¢ÇÒͨ¹ý²éѯ·½· ......
DataSetµ¼³öxml Åú´¦Àí(Ñ»·)µÃÔõô´¦Àí
XMLÎļþ
<A>
<B>
<C>
</C>
&nb ......
<?xml version="1.0"?>
<root>
<status>433</status>
<msg>Õâ¸öÊǺº×Ö</msg>
<serialno>123</serialno>
</root>
ÈçºÎÓÃASP¶ÁÈ¡ statusÖµ ......
ÔÚactionÖÐÖÁÉÙÓÐ4¸ö·½·¨£¬Ã¿¸ö·½·¨½ÓÊÜÒ»ÖÖÇëÇó£¬ÀýÈçËĸö·½·¨×î¼òµ¥µÄ¾ÍÊÇÔöɾ¸Ä²é£¬Ã¿Ò»ÖÖ²Ù×÷£¬ÐèҪУÑéµÄactionÊôÐÔÊDz»Í¬µÄ£¬Ð£ÑéÊôÐԵĹæÔòÒ²ÊDz»Í¬µÄ£¬ÔõôÑù²ÅÄÜʹÓÃxmlµÄÊäÈëУÑ飿
Èç¹ûÊÇʹÓÃactionName ......
Çë¸ßÊÖÖ¸½ÌÓÃjavaʵÏÖ¸ù¾ÝxsdÎļþÉú³ÉxmlÎļþ£¬Ð¡µÜ³õѧϣÍûÄܸø¸öʵÀý£¡Ð»Ð»£¡
ÆÚ´ý¸ßÊÖÖ¸½Ì£¡£¡£¡£¡£¡£¡£¡£¡
ûÈËÖªµÀÂ𡣡£¡£¡£¡£¡£¡£¡£¡£¡£
ÒýÓÃ
schema xsd ÎļþÊÇÓÃÓÚÑéÖ¤ XML ¸ñʽµÄ£¬²¢²»ÊÇÓÃÓÚÉú ......