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

ÀûÓÃVC++ÓëMSXML½âÎöXMLÎĵµ


Ò»¡¢Îĵµ¶ÔÏóÄ£ÐÍ£¨DOM£©
¡¡¡¡DOMÊÇDocument Object Model£¨Îĵµ¶ÔÏóÄ£ÐÍ£©µÄ¼ò³Æ£¬ÊǶÔXMLÎĵµ½øÐÐÓ¦Óÿª·¢¡¢±à³ÌµÄÓ¦ÓóÌÐò½Ó¿Ú£¨API£©¡£×÷ΪW3C¹«²¼µÄÒ»ÖÖ¿çƽ̨¡¢ÓëÓïÑÔÎ޹صĽӿڹ淶£¬DOMÌṩÁËÔÚ²»Í¬»·¾³ºÍÓ¦ÓÃÖеıê×¼³ÌÐò½Ó¿Ú£¬¿ÉÒÔÓÃÈκÎÓïÑÔʵÏÖ¡£
¡¡¡¡DOM²ÉÓöÔÏóÄ£ÐͺÍһϵÁеĽӿÚÀ´ÃèÊöXMLÎĵµµÄÄÚÈݺͽṹ£¬¼´ÀûÓöÔÏó°ÑÎĵµÄ£ÐÍ»¯¡£ÕâÖÖ¶ÔÏóÄ£ÐÍʵÏֵĻù±¾¹¦ÄÜ°üÀ¨£º
¡¡¡¡¡ñ ÃèÊöÎĵµ±íʾºÍ²Ù×÷µÄ½Ó¿Ú£»
¡¡¡¡¡ñ ½Ó¿ÚµÄÊôÐԺͷ½·¨£»
¡¡¡¡¡ñ ½Ó¿ÚÖ®¼äµÄ¹ØϵÒÔ¼°»¥²Ù×÷¡£
¡¡¡¡DOM¿É¶Ô½á¹¹»¯µÄXMLÎĵµ½øÐнâÎö£¬ÎĵµÖеÄÖ¸Áî¡¢ÔªËØ¡¢ÊµÌå¡¢ÊôÐÔµÈËùÓÐÄÚÈݸöÌ嶼ÓöÔÏóÄ£Ðͱíʾ£¬Õû¸öÎĵµ±»¿´³ÉÊÇÒ»¸öÓнṹµÄÐÅÏ¢Ê÷£¬¶ø²»ÊǼòµ¥µÄÎı¾Á÷£¬Éú³ÉµÄ¶ÔÏóÄ£Ð;ÍÊÇÊ÷µÄ½Úµã£¬¶ÔÏóͬʱ°üº¬ÁË·½·¨ºÍÊôÐÔ¡£Òò´Ë£¬¶ÔÎĵµµÄËùÓвÙ×÷¶¼ÊÇÔÚ¶ÔÏóÊ÷ÉϵĽøÐС£ÔÚDOMÖУ¬Ê÷ÖеÄÒ»Çж¼ÊǶÔÏ󣬲»¹ÜÊǸù½Úµã»¹ÊÇʵÌåµÄÊôÐÔ¡£
¡¡¡¡ÔÚDOMÖÐÖ÷ÒªÓÐÒÔÏÂÈý¸ö¶ÔÏó£º
¡¡¡¡¡ñ XMLÎĵµ¶ÔÏó
XMLÎĵµ¼ÈÊÇÒ»ÖÖ¶ÔÏó£¬Í¬Ê±ÓÖ´ú±íÕû¸öXMLÎĵµ¡£ËüÓɸùÔªËغÍ×ÓÔªËØ×é³É¡£
¡¡¡¡¡ñ XML½Úµã¶ÔÏó
XML½Úµã¶ÔÏó´ú±íµÄÊÇXMLÎĵµÄÚ²¿µÄ½Úµã£¬ÈçÔªËØ¡¢×¢ÊÍ¡¢Ãû×Ö¿Õ¼äµÈ¡£
¡¡¡¡¡ñ XML½ÚµãÁбí
XMLÎĵµÄ£¿éÁбí´ú±íÁ˽ڵãµÄ¼¯ºÏ¡£
¡¡¡¡ÀûÓÃDOM£¬¿ª·¢ÈËÔ±¿ÉÒÔ¶¯Ì¬µØ´´½¨XMLÎĵµ£¬±éÀú½á¹¹£¬Ìí¼Ó¡¢Ð޸ġ¢É¾³ýÄÚÈݵȡ£ÆäÃæÏò¶ÔÏóµÄÌØÐÔ£¬Ê¹ÈËÃÇÔÚ´¦ÀíXML½âÎöÏà¹ØµÄÊÂÎñʱ½ÚÊ¡´óÁ¿µÄ¾«Á¦£¬ÊÇÒ»ÖÖ·ûºÏ´úÂëÖØÓÃ˼ÏëµÄÇ¿ÓÐÁ¦±à³Ì¹¤¾ß¡£
¶þ¡¢DOMµÄËĸö»ù±¾½Ó¿Ú(ÒýÓÃ×Ô£ºhttp://bbs.xml.org.cn/dispbbs.asp?boardID=11&ID=9220)
ÔÚDOM½Ó¿Ú¹æ·¶ÖУ¬ÓÐËĸö»ù±¾µÄ½Ó¿Ú£ºDocument£¬Node£¬NodeListÒÔ¼°NamedNodeMap¡£ÔÚÕâËĸö»ù±¾½Ó¿ÚÖУ¬Document½Ó¿ÚÊǶÔÎĵµ½øÐвÙ×÷µÄÈë¿Ú£¬ËüÊÇ´ÓNode½Ó¿Ú¼Ì³Ð¹ýÀ´µÄ¡£Node½Ó¿ÚÊÇÆäËû´ó¶àÊý½Ó¿ÚµÄ¸¸À࣬ÏóDocumet£¬Element£¬Attribute£¬Text£¬CommentµÈ½Ó¿Ú¶¼ÊÇ´ÓNode½Ó¿Ú¼Ì³Ð¹ýÀ´µÄ¡£NodeList½Ó¿ÚÊÇÒ»¸ö½ÚµãµÄ¼¯ºÏ£¬Ëü°üº¬ÁËij¸ö½ÚµãÖеÄËùÓÐ×ӽڵ㡣NamedNodeMap½Ó¿ÚÒ²ÊÇÒ»¸ö½ÚµãµÄ¼¯ºÏ£¬Í¨¹ý¸Ã½Ó¿Ú£¬¿ÉÒÔ½¨Á¢½ÚµãÃûºÍ½ÚµãÖ®¼äµÄÒ»Ò»Ó³Éä¹Øϵ£¬´Ó¶øÀûÓýڵãÃû¿ÉÒÔÖ±½Ó·ÃÎÊÌض¨µÄ½Úµã¡£ÏÂÃ潫¶ÔÕâËĸö½Ó¿Ú·Ö±ð×öһЩ¼òµ¥µÄ½éÉÜ¡£
1¡¢Document½Ó¿Ú
Document½Ó¿Ú´ú±íÁËÕû¸öXML/HTMLÎĵµ£¬Òò´Ë£¬ËüÊÇÕû¿ÃÎĵµÊ÷µÄ¸ù£¬ÌṩÁ˶ÔÎĵµÖеÄÊý¾Ý½øÐзÃÎʺͲÙ×÷µÄÈë¿Ú¡£
ÓÉÓÚÔªËØ¡¢Îı¾½Úµã¡¢×¢ÊÍ¡¢´¦ÀíÖ¸ÁîµÈ¶¼²»ÄÜÍÑÀëÎĵµµÄÉÏÏÂÎĹØϵ¶ø¶ÀÁ¢´æÔ


Ïà¹ØÎĵµ£º

XMLÖк¬ÓÐhtml±êÇ©µÄÎÊÌâ

¿´½áÂÛÇëÖ±½Ó¿´ÏÂÃæ
½ñÌìдÉú³ÉxmlµÄphp¡£Ã»ÓÐÓÃʲôXMLDOMNodeÖ®ÀàµÄÀ´Éú³É£¬¶øÊÇÖ±½Óecho³öxmlµÄÄÚÈÝ¡£
xmlµÄÄÚÈÝÖÐÓÐÒ»²¿·ÖµÄÊý¾ÝÊÇ´ÓdbÖÐÑ­»·È¡³öµÄ£¬ÎÊÌâ¾Í³öÔÚÕâ¡£ÎÒ·¢ÏÖÈ«²¿È¡³öÊý¾Ýʱ£¬¶ÔÓÚÉú³ÉµÄxml£¬simplexml_load_string·µ»Øfalse£¬¼´±íÃ÷Éú³ÉµÄxmlÊÇ·Ç·¨µÄ¡£
debugһϣ¬·¢ÏÖÈ¡³öÊý¾Ý¼ÓÒÔÏÞÖÆ limit 8 һϠ......

ÓÃjdom¶ÔxmlÎļþµÄ¶ÁÈ¡

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import org.jdom.xpath.XPath;
public class XMLReader {
 priv ......

javaÓëc++µÄÇø±ð

//1.JavaÖÐ×Ö·û´®²»ÄܶàÐÐÊéд¡£¶àÐÐÊéдÓÃÒýºÅ¸ô¶Ï£¬¼ÓºÅÏàÁ¬¡£  
  //2.JavaµÄ±êʶ·û¿ÉÒÔÓÃÃÀÔª·ûºÅ¿ªÍ·¡£  
  //3.JavaÖÐûÓÐÎÞ·ûºÅ±äÁ¿»òÎÞ·ûºÅ³£Á¿µÄ¸ÅÄî¡£ËùÓеıäÁ¿¶¼ÊÇÓзûºÅµÄ¡£  
  //4.JavaÖбäÁ¿µÄ×Ö³¤Êǹ̶¨µÄ¡£²»´æÔÚcharºÍwcharÖ®·Ö¡£  
  //5.JavaÖбäÁ¿Î ......

¡¾C\C++ÓïÑÔÈëÃÅƪ¡¿ λÔËËã


»Ø¹Ë֮ǰµÄƪ·ù£¬CÓïÑÔµÄÖ÷Ì岿·Ö»ù±¾ÒѾ­½éÉÜÍêÁË¡£Ö®ËùÒÔûÓнéÉÜC++µÄÏà¹ØÌØÐÔÊÇÒòΪÔÚ֮ǰµÄÎÄÕÂÖÐCºÍC++ÔÚÕâЩ·½Ã涼Óй²ÐÔ£¬ËùÒÔÔÚÃæÏò¶ÔÏó֮ǰ¡£ÎÒÃÇÏÈ°ÑÕâЩ¹²ÐÔ¸ø½éÉÜÍê¡£Ò²¾ÍÊÇ˵ÔÚ½éÉÜÃæÏò¶ÔÏó֮ǰ£¬ËùÓеÄÎÄÕ¶¼ÊÇCC++Öж¼ÄÜʹÓõġ£´ÓÕâµãÉÏÀ´¿´£¬ÏÖÔÚÕý¼«Á¦·Ü¶·ÓÚC++Õ½ÏßÉϵijõѧÕß»¹ÊǺÜÓÐÓô¦µÄ¡£
±¾Æª¼ ......

Delphiµ÷ÓÃVC++6.0±àдµÄDll

ÓÃVC++6.0±àдÁËÒ»¸ö¼òµ¥µÄdll£¬ÀïÃæ°üº¬Ò»¸ö¼õ·¨º¯Êýsubtract(int a,int b)£¬DllÃüÃûΪff.Dll
´úÂëÈçÏ£º
1.ff.cpp:
// ff.cpp : Defines the entry point for the DLL application.
//
#include "StdAfx.h"
#include "ff.h"
BOOL APIENTRY DllMain( HANDLE hModule,
        ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ