Çë°ïæÓÃvc++½âÎöxmlÎļþ - VC/MFC / HTML/XML
ÏÖÔÚÐèÒª×ö¸öÈí¼þÀ´½âÎöxml¸ñʽµÄÎļþ£¬Çë´óÏÀßø¸öÏà¹ØµÄÀý×Ó£¬ÖªµÀһϣ¬¸Ð¼¤²»¾¡£¡£¡£¡ÓÐÀý×Ӿ͸ø·ÖŶ£¡£¡£¡
ÓÃ MSXML
¸øÄãÒ»¶ÎÎÒÔÀ´Ð´µÄÒ»¶Î´úÂ룬ÓÐʲô²»Ã÷°×µÄ×Ô¼ºÈ¥²é×ÊÁϰɣ¬²»ËãÌ«ÄÑ
C/C++ code:
MSXML2::IXMLDOMDocumentPtr pXMLDom;
HRESULT hr;
hr= pXMLDom.CreateInstance(__uuidof(DOMDocument30));
if (FAILED(hr))
{
return FALSE;
}
pXMLDom->async = VARIANT_FALSE; // default - true,
if(pXMLDom->load(_T("Device.xml"))!=VARIANT_TRUE)
{
MessageBox(_T("¼ÓÔØÅäÖÃÎļþʧ°Ü"));
return FALSE;
}
else
{
MSXML2::IXMLDOMNodePtr node;
MSXML2::IXMLDOMNodeListPtr list;
list = pXMLDom->selectNodes(_T("//Road/*"));
if(list == NULL)
{
MessageBox(_T("Î޼Ǽ"));
}
else
{
int j = list->length;
for(int i = 0;i<j;i++)
{
node = list->item[i];
//½ÚµãÃû³Æ
CString Nodename = node->nodeName;
if(Nodename.Compare(_T("RoadName")) == 0)
{
//½«Â·¿ÚÃûдÈëÊ÷¿Ø¼þ
CString RoadName = node->text;
road = m_DeviceTree.InsertItem(RoadName,root);
Ïà¹ØÎÊ´ð£º
´ÓÊý¾Ý¿âÖвéѯһÕűíµÄÊý¾Ý
select ²¿ÃÅ,ÐÕÃû from tb
ÈçºÎ²ÅÄÜÉú³ÉÏÂÃæµÄxml¸ñʽ
XML code:
<folder state="unchecked" label="È«²¿">
¡¡¡¡ <folder state="unchecked&qu ......
ÎÒÓõÄÊÇÁ¬½Ó³Ø×öµÄ£¬ÅäÁ¬½Ó³ØµÄ·½·¨Ó¦¸ÃûÓÐ´í£¬ÎªÊ²¾ÍÊdzöÏÖÕâÖÖÎÊÌâ
javax.servlet.ServletException: javax.naming.NameNotFoundException: No object bound to name java:comp/env/test
ÇëÎÊ´óÏÀÃÇÕâÊÇÔ ......
´ó¼ÒºÃ£º
ÎÒÏëʵÏÖ¼ì²âµ½²åÈëSD¿¨ºó×Ô¶¯½«SD¿¨¸ñʽ»¯µÄ¹¦ÄÜ£¬²»ÖªC/C++ÖÐÓÐûÓиñʽ»¯UÅ̵ĺ¯Êý£¿
ÁíÍ⣬ÎÒ²»ÏëʹÓÃSHFormatDrive£¬ÒòΪÕâ¸öº¯Êý»áµ¯³öÊÇ·ñÒª¸ñʽ»¯µÄÌáʾ¿ò£¬ÎÒÐèÒªµÄÊÇϵͳ×Ô¶¯¸ñʽ»¯£¬¶ø²Ù×÷Õß² ......
ÈçÌ⣬ÔÚWINDOWSµ×ϵÄCODE»á£¬µ«ÔÚLINUXϲ»ÖªµÀÈçºÎʵÏÖ£¬JSµÄ´úÂëÓ¦¸ÃÊDz»Ò»ÑùµÄ¡£ Çó½Ì¡£
·Ö²»¹»ÔÙ¼Ó¡£
http://topic.csdn.net/u/20100113/08/17ba1e71-4c33-43f6-91a5-0e031c86e5ed.html
linux ......
ÔÚ·¢±íÆÀÂÛʱ ¹ýÂË ÈçºÎ£º<br/> <hr/> Ë«ÒýºÅ µ¥ÒýºÅ »¹ÓÐÆäËû µÈ Óкõķ½·¨¸æËßһϠлл
.replace(/<\w+[^>]*>/g,"").replace(/'/g,"''")
½«µ¥ÒýºÅ»»³É2¸ö ......