Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

½øÐÐxmlµÄschemaУÑéµÄÎÊÌâ......

    ÈçºÎ½øÐÐxmlµÄschemaУÑ飿£¿ÎÒÏëÒ»´Î¶¼ÕÒ³öxmlÎĵµÖÐËùÓв»·ûºÏschema¹æ·¶µÄÐÅÏ¢£¬²»ÖªµÀÔõô²Ù×÷£¬Çë¸ßÊÖÖ¸µã¡£¡£¡£¡£¡£¡£¡£¸Ð¼¤²»¾¡

/////////////// schema УÑé
// ½¨Á¢schema¹¤³§
SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
// ½¨Á¢ÑéÖ¤ÎĵµÎļþ¶ÔÏó£¬ÀûÓôËÎļþ¶ÔÏóËù·â×°µÄÎļþ½øÐÐschemaÑéÖ¤
File schemaFile = new File("myschema.xsd");
// ÀûÓÃschema¹¤³§£¬½ÓÊÕÑéÖ¤ÎĵµÎļþ¶ÔÏóÉú³ÉSchema¶ÔÏó
Schema schema = schemaFactory.newSchema(schemaFile);
// ͨ¹ýSchema²úÉúÕë¶ÔÓÚ´ËSchemaµÄÑéÖ¤Æ÷£¬ÀûÓÃstudents.xsd½øÐÐÑéÖ¤
Validator validator = schema.newValidator(); 
// µÃµ½ÑéÖ¤µÄÊý¾ÝÔ´£¬¾ÍÊÇxmlÎļþ
Source source = new StreamSource("myxml.xml");
// ¿ªÊ¼ÑéÖ¤£¬³É¹¦Êä³ösuccess!!!£¬Ê§°ÜÊä³öfail
try {
validator.validate(source);
System.out.println("Validation success!");
} catch (SAXParseException ex) {
System.out.println("Validation fail!");
ex.printStackTrace();
}

ÒÔÉϵÄУÑéÐÎʽ£¬Ö»ÄÜÕÒµ½µÚÒ»¸ö´íÎóµÄµØ·½£¬²»ÄÜÈ«²¿ÕÒ³ö²»·ûºÏschema¹æ·¶µÄÐÅÏ¢£¬
ÎÊÌ⣺
ÄÇÔõÑù²ÅÄÜÕÒ³öËùÓеĴíÎóÐÅÏ¢£¿£¿

ÇëÖ¸µã¡£

ûÓÐ×ö¹ýÀàËÆÓ¦Óã¬ÓпհïÂ¥Ö÷¿´¿´£¬Ïȶ¥Ò»Ï¡£


лл¹Ø×¢£¡


Ïà¹ØÎÊ´ð£º

ÈçºÎ½«XMLÊý¾Ý´æÈëACCESSÊý¾Ý¿â

ÇëÎʸ÷λ´óʦ£¬ÎÒÏÖÔÚÐèÒª½«XMLµÄÊý¾ÝʵʱµÄ´æÈëµ½Êý¾Ý¿âÖУ¬ÎÒÊÇÓÃasp±àµÄ³ÌÐò£¬´óÁ¿Ãǰïæ·ÖÎö һϣ¡£¡£¡
ÏÂÃæÊÇÎÒµÄXMLÎļþ´úÂë
XML code:

<?xml version="1.0" encoding="utf-8"? ......

ÈçºÎÌá½»xmlÀàÐÍÊý¾Ý - .NET¼¼Êõ / ASP.NET

Êý¾Ý¿â±íÖÐÓÐÒ»ÁУ¨TranXml£©ÀàÐÍÊÇxml£¬´æ´¢µÄÊÇÀàËÆ
<fathernode>
  <a>aaa
  </a>
  <b>bbb
  </b>
</fathernode>
µÄÐÅÏ¢£¬²¢ÇÒͨ¹ý²éѯ·½· ......

¶Ôxml½øÐнâÎö±àÂëÎÊÌâ

ÎÒµÄXMLÅäÖÃÎļþÀïÃæÓÐÖÐÎÄ×Ö·û,Ò²ÓÐÀàËÆÓÚ=~@!ÕâÖÖ×Ö·û,encodeingÉèÖÃΪgb2312  ºÍ  unicode,unicode  UTF-8,½á¹û¶¼Ìáʾϵͳ´íÎó,,,Èç¹ûÉèÖÃΪgb2312µÄ»°,È¥µô=!@ÕâÖÖ×Ö·û,Ò»Çж¼Õý³£.
ÓÉÓÚÎ ......

ºÃ ÇëÎÊÓÐʲôXMLµÄºÃÊé

ºÃ ÎÒÏëѧϰXMLºÃÊ飬ÇëÎÊÓÐʲôÊ飬¿ÉÒÔÉîÈëµÄѧϰÏÂµÄ Ð»Ð»
ÎÞ·Ï»°XML ̨ÍåÁ½Ö»ÀÏ»¢

XMLÈëÞ­µä

ÓÑÇé °ï¶¥¡£

ÎÞ·Ï»°XML ̨ÍåÁ½Ö»ÀÏ»¢ÖªÊ¶µã±È½ÏÉÙ

XML´ÓÈëÃŵ½¾«Í¨
......

Êý¾ÝÒÔxml¸ñʽ·µ»Ø - MS-SQL Server / Ó¦ÓÃʵÀý

´ÓÊý¾Ý¿âÖвéѯһÕűíµÄÊý¾Ý
select ²¿ÃÅ,ÐÕÃû from tb
ÈçºÎ²ÅÄÜÉú³ÉÏÂÃæµÄxml¸ñʽ
XML code:
<folder state="unchecked" label="È«²¿">
¡¡¡¡ <folder state="unchecked&qu ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ