亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mxml.html

?? minixml2.5最新的版本。 嵌入式xml 解析、查找、生成、遍歷 功能,全部實現是標準c,移植很容易。 最新的2.5
?? HTML
?? 第 1 頁 / 共 5 頁
字號:
<P>The second argument is the stdio file to write to, as opened by <TT>fopen()</TT> or <TT>popen()</TT>. You can also use <TT>stdout</TT> if you are implementing an XML filter program.</P><P>The third argument is the whitespace callback to use when saving the file. Whitespace callbacks are covered in detail in <A href="SAVE_CALLBACKS">Chapter 3</A>. The previous example code uses the <TT>MXML_NO_CALLBACK</TT> constant to specify that no special whitespace handling is required.</P><P>The <A href="#mxmlSaveAllocString"><TT>mxmlSaveAllocString</TT></A>, and <A href="#mxmlSaveString"><TT>mxmlSaveString</TT></A> functions save XML node trees to strings:</P><PRE>    char buffer[8192];    char *ptr;    mxml_node_t *tree;    ...    mxmlSaveString(tree, buffer, sizeof(buffer),                   MXML_NO_CALLBACK);    ...    ptr = mxmlSaveAllocString(tree, MXML_NO_CALLBACK);</PRE><P>The first and last arguments are the same as used for <TT>mxmlSaveFile()</TT>. The <TT>mxmlSaveString</TT> function takes pointer and size arguments for saving the XML document to a fixed-size buffer, while <TT>mxmlSaveAllocString()</TT> returns a string buffer that was allocated using <TT>malloc()</TT>.</P><H3><A NAME="3_5_1">Controlling Line Wrapping</A></H3><P>When saving XML documents, Mini-XML normally wraps output lines at column 75 so that the text is readable in terminal windows. The <A href="#mxmlSetWrapMargin"><TT>mxmlSetWrapMargin</TT></A> function overrides the default wrap margin:</P><PRE>    /* Set the margin to 132 columns */    mxmlSetWrapMargin(132);    /* Disable wrapping */    mxmlSetWrapMargin(0);</PRE><!-- NEW PAGE--><H2><A NAME="3_6">Finding and Iterating Nodes</A></H2><P>The <A href="#mxmlWalkPrev"><TT>mxmlWalkPrev</TT></A> and <A href="#mxmlWalkNext"><TT>mxmlWalkNext</TT></A>functions can be used to iterate through the XML node tree:</P><PRE>    mxml_node_t *node;        node = mxmlWalkPrev(current, tree,                        MXML_DESCEND);    node = mxmlWalkNext(current, tree,                        MXML_DESCEND);</PRE><P>In addition, you can find a named element/node using the <A href="#mxmlFindElement"><TT>mxmlFindElement</TT></A> function:</P><PRE>    mxml_node_t *node;        node = mxmlFindElement(tree, tree, &quot;name&quot;,                           &quot;attr&quot;, &quot;value&quot;,                           MXML_DESCEND);</PRE><P>The <TT>name</TT>, <TT>attr</TT>, and <TT>value</TT> arguments can be passed as <TT>NULL</TT> to act as wildcards, e.g.:</P><!-- NEED 4 --><PRE>    /* Find the first &quot;a&quot; element */    node = mxmlFindElement(tree, tree, &quot;a&quot;,                           NULL, NULL,                           MXML_DESCEND);</PRE><!-- NEED 5 --><PRE>    /* Find the first &quot;a&quot; element with &quot;href&quot;       attribute */    node = mxmlFindElement(tree, tree, &quot;a&quot;,                           &quot;href&quot;, NULL,                           MXML_DESCEND);</PRE><!-- NEED 6 --><PRE>    /* Find the first &quot;a&quot; element with &quot;href&quot;       to a URL */    node = mxmlFindElement(tree, tree, &quot;a&quot;,                           &quot;href&quot;,                           &quot;http://www.easysw.com/&quot;,                           MXML_DESCEND);</PRE><!-- NEED 5 --><PRE>    /* Find the first element with a &quot;src&quot;       attribute */    node = mxmlFindElement(tree, tree, NULL,                           &quot;src&quot;, NULL,                           MXML_DESCEND);</PRE><!-- NEED 5 --><PRE>    /* Find the first element with a &quot;src&quot;       = &quot;foo.jpg&quot; */    node = mxmlFindElement(tree, tree, NULL,                           &quot;src&quot;, &quot;foo.jpg&quot;,                           MXML_DESCEND);</PRE><P>You can also iterate with the same function:</P><PRE>    mxml_node_t *node;    for (node = mxmlFindElement(tree, tree,                                &quot;name&quot;,                                NULL, NULL,                                MXML_DESCEND);         node != NULL;         node = mxmlFindElement(node, tree,                                &quot;name&quot;,                                NULL, NULL,                                MXML_DESCEND))    {      ... do something ...    }</PRE><!-- NEED 10 --><P>The <TT>MXML_DESCEND</TT> argument can actually be one of three constants:</P><UL><LI><TT>MXML_NO_DESCEND</TT> means to not to look at any child nodes in the element hierarchy, just look at siblings at the same level or parent nodes until the top node or top-of-tree is reached.<P>The previous node from &quot;group&quot; would be the &quot;node&quot; element to the left, while the next node from &quot;group&quot; would be the &quot;node&quot; element to the right.<BR><BR></P></LI><LI><TT>MXML_DESCEND_FIRST</TT> means that it is OK to descend to the first child of a node, but not to descend further when searching. You'll normally use this when iterating through direct children of a parent node, e.g. all of the &quot;node&quot; and &quot;group&quot; elements under the &quot;?xml&quot; parent node in the example above.<P>This mode is only applicable to the search function; the walk functions treat this as <TT>MXML_DESCEND</TT> since every call is a first time.<BR><BR></P></LI><LI><TT>MXML_DESCEND</TT> means to keep descending until you hit the bottom of the tree. The previous node from &quot;group&quot; would be the &quot;val3&quot; node and the next node would be the first node element under &quot;group&quot;.<P>If you were to walk from the root node &quot;?xml&quot; to the end of the tree with <TT>mxmlWalkNext()</TT>, the order would be:</P><P><TT>?xml data node val1 node val2 node val3 group node val4 node val5 node val6 node val7 node val8</TT></P><P>If you started at &quot;val8&quot; and walked using <TT>mxmlWalkPrev()</TT>, the order would be reversed, ending at &quot;?xml&quot;.</P></LI></UL><HR NOSHADE><H1 align="right"><A name="ADVANCED"><IMG align="right" alt="3" height="100"hspace="10" src="3.gif" width="100"></A>More Mini-XML Programming Techniques</H1><P>This chapter shows additional ways to use the Mini-XML library in your programs.</P><H2><A name="LOAD_CALLBACKS">Load Callbacks</A></H2><P><A href="#LOAD_XML">Chapter 2</A> introduced the <A href="#mxmlLoadFile"><TT>mxmlLoadFile()</TT></A> and <A href="#mxmlLoadString"><TT>mxmlLoadString()</TT></A> functions. The last argument to these functions is a callback function which is used to determine the value type of each data node in an XML document.</P><P>Mini-XML defines several standard callbacks for simple XML data files:</P><UL><LI><TT>MXML_INTEGER_CALLBACK</TT> - All data nodes contain whitespace-separated integers.</LI><LI><TT>MXML_OPAQUE_CALLBACK</TT> - All data nodes contain opaque strings (&quot;CDATA&quot;).</LI><LI><TT>MXML_REAL_CALLBACK</TT> - All data nodes contain whitespace-separated floating-point numbers.</LI><LI><TT>MXML_TEXT_CALLBACK</TT> - All data nodes contain whitespace-separated strings.</LI></UL><P>You can provide your own callback functions for more complex XML documents. Your callback function will receive a pointer to the current element node and must return the value type of the immediate children for that element node: <TT>MXML_INTEGER</TT>, <TT>MXML_OPAQUE</TT>, <TT>MXML_REAL</TT>, or <TT>MXML_TEXT</TT>. The function is called<I> after</I> the element and its attributes have been read, so you can look at the element name, attributes, and attribute values to determine the proper value type to return.</P><!-- NEED 2in --><P>The following callback function looks for an attribute named &quot;type&quot; or the element name to determine the value type for its child nodes:</P><PRE>    mxml_type_t    type_cb(mxml_node_t *node)    {      const char *type;     /*      * You can lookup attributes and/or use the      * element name, hierarchy, etc...      */      type = mxmlElementGetAttr(node, &quot;type&quot;);      if (type == NULL)	type = node-&gt;value.element.name;      if (!strcmp(type, &quot;integer&quot;))	return (MXML_INTEGER);      else if (!strcmp(type, &quot;opaque&quot;))	return (MXML_OPAQUE);      else if (!strcmp(type, &quot;real&quot;))	return (MXML_REAL);      else	return (MXML_TEXT);    }</PRE><P>To use this callback function, simply use the name when you call any of the load functions:</P><PRE>    FILE *fp;    mxml_node_t *tree;    fp = fopen(&quot;filename.xml&quot;, &quot;r&quot;);    tree = mxmlLoadFile(NULL, fp, <B>type_cb</B>);    fclose(fp);</PRE><H2><A name="SAVE_CALLBACKS">Save Callbacks</A></H2><P><A href="#LOAD_XML">Chapter 2</A> also introduced the <A href="#mxmlSaveFile"><TT>mxmlSaveFile()</TT></A>, <A href="#mxmlSaveString"><TT>mxmlSaveString()</TT></A>, and <A href="#mxmlSaveAllocString"><TT>mxmlSaveAllocString()</TT></A> functions. The last argument to these functions is a callback function which is used to automatically insert whitespace in an XML document.</P><P>Your callback function will be called up to four times for each element node with a pointer to the node and a &quot;where&quot; value of <TT>MXML_WS_BEFORE_OPEN</TT>, <TT>MXML_WS_AFTER_OPEN</TT>, <TT>MXML_WS_BEFORE_CLOSE</TT>, or <TT>MXML_WS_AFTER_CLOSE</TT>. The callback function should return <TT>NULL</TT> if no whitespace should be added and the string to insert (spaces, tabs, carriage returns, and newlines) otherwise.</P><P>The following whitespace callback can be used to add whitespace to XHTML output to make it more readable in a standard text editor:</P><PRE>    const char *    whitespace_cb(mxml_node_t *node,                  int where)    {      const char *name;     /*      * We can conditionally break to a new line      * before or after any element. These are      * just common HTML elements...      */      name = node-&gt;value.element.name;      if (!strcmp(name, &quot;html&quot;) ||          !strcmp(name, &quot;head&quot;) ||          !strcmp(name, &quot;body&quot;) ||	  !strcmp(name, &quot;pre&quot;) ||          !strcmp(name, &quot;p&quot;) ||	  !strcmp(name, &quot;h1&quot;) ||          !strcmp(name, &quot;h2&quot;) ||          !strcmp(name, &quot;h3&quot;) ||	  !strcmp(name, &quot;h4&quot;) ||          !strcmp(name, &quot;h5&quot;) ||          !strcmp(name, &quot;h6&quot;))      {       /*	* Newlines before open and after        * close...	*/	if (where == MXML_WS_BEFORE_OPEN ||            where == MXML_WS_AFTER_CLOSE)	  return (&quot;\n&quot;);      }      else if (!strcmp(name, &quot;dl&quot;) ||               !strcmp(name, &quot;ol&quot;) ||               !strcmp(name, &quot;ul&quot;))      {       /*	* Put a newline before and after list        * elements...	*/	return (&quot;\n&quot;);      }      else if (!strcmp(name, &quot;dd&quot;) ||               !strcmp(name, &quot;dt&quot;) ||               !strcmp(name, &quot;li&quot;))      {       /*	* Put a tab before &lt;li&gt;'s, * &lt;dd&gt;'s,        * and &lt;dt&gt;'s, and a newline after them...	*/	if (where == MXML_WS_BEFORE_OPEN)	  return (&quot;\t&quot;);	else if (where == MXML_WS_AFTER_CLOSE)	  return (&quot;\n&quot;);      }     /*      * Return NULL for no added whitespace...      */      return (NULL);    }</PRE><P>To use this callback function, simply use the name when you call any of the save functions:</P><PRE>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 51精品国自产在线| 欧美一区二区三区免费视频| 久久亚洲精精品中文字幕早川悠里 | 国产人成一区二区三区影院| 1024成人网| 日韩不卡一二三区| 福利一区福利二区| 欧洲一区在线观看| 久久一区二区三区四区| 中文字幕一区三区| 日韩电影一区二区三区四区| 国产河南妇女毛片精品久久久| 91浏览器在线视频| 日韩精品一区二区三区在线播放| 中文字幕巨乱亚洲| 天使萌一区二区三区免费观看| 国产一区二区三区久久悠悠色av| 色综合一个色综合| 精品美女在线观看| 亚洲最大成人综合| 国产成人综合亚洲91猫咪| 欧美在线观看一区二区| 久久综合久久鬼色中文字| 亚洲免费av在线| 国产精品中文有码| 欧美片网站yy| 中文字幕一区二区不卡| 日韩福利电影在线| 99国产欧美久久久精品| 精品少妇一区二区三区在线视频| 亚洲日本丝袜连裤袜办公室| 极品少妇一区二区| 在线免费观看日韩欧美| 国产女同互慰高潮91漫画| 日韩电影免费在线看| 一本色道久久加勒比精品| 久久久国产综合精品女国产盗摄| 天堂va蜜桃一区二区三区| 99国产精品国产精品久久| 久久久.com| 麻豆精品蜜桃视频网站| 欧美色综合久久| 中文字幕国产精品一区二区| 久99久精品视频免费观看| 欧美日韩精品欧美日韩精品一| 亚洲欧美视频在线观看视频| 国产福利一区二区三区| 欧美一级搡bbbb搡bbbb| 亚洲香肠在线观看| 91啪九色porn原创视频在线观看| 久久精品人人做人人爽人人| 蜜臀精品一区二区三区在线观看| 欧美日本一区二区三区四区 | 一本久久精品一区二区| 国产精品网站在线播放| 精品一二三四区| 日韩一级成人av| 午夜欧美电影在线观看| 欧美在线三级电影| 亚洲黄一区二区三区| 91免费视频大全| 中文字幕一区二区三区乱码在线| 国产福利91精品一区二区三区| 精品国产不卡一区二区三区| 日本vs亚洲vs韩国一区三区二区| 欧美狂野另类xxxxoooo| 一区av在线播放| 在线观看国产91| 亚洲一区二区三区自拍| 欧美探花视频资源| 亚洲成a人片在线观看中文| 在线视频一区二区三区| 一二三区精品视频| 欧美午夜片在线看| 亚洲国产精品精华液网站| 欧美系列日韩一区| 亚洲成人免费在线观看| 欧美日韩激情一区| 日日欢夜夜爽一区| 欧美一区2区视频在线观看| 日韩福利视频导航| 日韩女同互慰一区二区| 国产一区二区三区久久久| 久久久久久99久久久精品网站| 国产黑丝在线一区二区三区| 国产精品初高中害羞小美女文| 99久久精品情趣| 亚洲一区二区三区激情| 337p亚洲精品色噜噜狠狠| 热久久一区二区| 精品va天堂亚洲国产| 盗摄精品av一区二区三区| 国产精品欧美一级免费| 91网站在线播放| 香蕉成人伊视频在线观看| 日韩欧美成人午夜| 国产成人精品一区二区三区网站观看 | 亚洲国产欧美日韩另类综合| 91精品国产手机| 韩日精品视频一区| 综合自拍亚洲综合图不卡区| 在线观看不卡视频| 另类调教123区 | 99久久免费精品高清特色大片| 亚洲乱码日产精品bd| 欧美美女网站色| 极品少妇一区二区| 亚洲欧美日韩一区二区| 欧美精三区欧美精三区| 国产一二三精品| 亚洲精品一卡二卡| 欧美一区二区在线不卡| 国产99精品在线观看| 一区二区三区丝袜| 日韩丝袜美女视频| 成人激情校园春色| 天天综合网 天天综合色| 久久久激情视频| 欧美日韩一区二区三区视频| 国产一区二区电影| 一区二区三区在线不卡| 26uuu另类欧美| 色天天综合久久久久综合片| 麻豆精品一二三| 亚洲情趣在线观看| 精品免费视频.| 91成人免费在线| 国产酒店精品激情| 亚洲成人午夜影院| 国产精品免费网站在线观看| 在线播放亚洲一区| 99热这里都是精品| 久久国产精品72免费观看| 亚洲男人都懂的| 久久欧美一区二区| 777欧美精品| 色偷偷88欧美精品久久久| 久久疯狂做爰流白浆xx| 一区二区国产视频| 中文字幕av一区二区三区高| 欧美一级二级三级乱码| 色猫猫国产区一区二在线视频| 韩日欧美一区二区三区| 午夜精品免费在线观看| 中文字幕精品综合| 欧美精品一区二区三区蜜臀| 欧美视频日韩视频在线观看| 99国产精品久| 国产激情视频一区二区在线观看 | 欧美一区二区三区性视频| 91蜜桃传媒精品久久久一区二区| 国产一区不卡视频| 日韩av一二三| 亚洲一区二区欧美日韩| 亚洲欧洲av另类| 日本一区二区三区免费乱视频| 日韩女优视频免费观看| 欧美女孩性生活视频| 色88888久久久久久影院野外| 成人毛片视频在线观看| 精品在线免费视频| 天堂蜜桃一区二区三区| 亚洲国产裸拍裸体视频在线观看乱了 | 日本免费在线视频不卡一不卡二| 亚洲一区二区三区四区中文字幕| 国产精品国产三级国产普通话99 | 成人免费视频网站在线观看| 国产在线播放一区三区四| 秋霞电影一区二区| 日韩精彩视频在线观看| 亚洲一区二区三区精品在线| 亚洲激情欧美激情| 有码一区二区三区| 亚洲啪啪综合av一区二区三区| 国产精品国产三级国产专播品爱网| 亚洲国产精品成人综合色在线婷婷 | 亚洲第一主播视频| 亚洲一区二区av电影| 一区二区三区欧美| 亚洲综合小说图片| 亚洲综合久久久| 亚洲在线观看免费| 香蕉久久一区二区不卡无毒影院 | 欧美日韩高清一区二区不卡| 欧美日韩中文精品| 欧美精品 日韩| 欧美一区二区三区免费大片| 日韩亚洲欧美在线观看| 精品剧情在线观看| 久久精品亚洲精品国产欧美| 国产欧美一区二区三区在线看蜜臀 | 亚洲欧洲精品一区二区精品久久久| 欧美激情资源网| 1000精品久久久久久久久| 亚洲三级在线播放| 一区二区三区精品在线观看| 亚洲高清免费在线| 日本欧美大码aⅴ在线播放| 韩国成人精品a∨在线观看|