aboutsummaryrefslogtreecommitdiffstats
path: root/doc/tutorial/ar01s07.html
diff options
context:
space:
mode:
authorMST 2002 John Fleck <jfleck@inkstain.net>2002-12-16 04:34:57 +0000
committerJohn Fleck <jfleck@src.gnome.org>2002-12-16 04:34:57 +0000
commit44aacb34043e6f18afb45fe5d0126808aa194d9a (patch)
tree3d9a1ffbb70c1d68c01dfe387c12be66819ab298 /doc/tutorial/ar01s07.html
parentda46d2d31e49503b087874cc987045dd09169d26 (diff)
downloadandroid_external_libxml2-44aacb34043e6f18afb45fe5d0126808aa194d9a.tar.gz
android_external_libxml2-44aacb34043e6f18afb45fe5d0126808aa194d9a.tar.bz2
android_external_libxml2-44aacb34043e6f18afb45fe5d0126808aa194d9a.zip
doc/tutorial/xmltutorial.xml doc/tutorial/includekeyword.c
Sun Dec 15 21:27:30 MST 2002 John Fleck <jfleck@inkstain.net> * doc/tutorial/xmltutorial.xml * doc/tutorial/includekeyword.c * doc/tutorial/includegetattribute.c plus generated html and pdf Adding fix from Niraj Tolia to tutorial to properly free memory.
Diffstat (limited to 'doc/tutorial/ar01s07.html')
-rw-r--r--doc/tutorial/ar01s07.html13
1 files changed, 8 insertions, 5 deletions
diff --git a/doc/tutorial/ar01s07.html b/doc/tutorial/ar01s07.html
index 9335237f..fe0bd7cd 100644
--- a/doc/tutorial/ar01s07.html
+++ b/doc/tutorial/ar01s07.html
@@ -11,14 +11,17 @@
void
getReference (xmlDocPtr doc, xmlNodePtr cur) {
+ xmlChar *uri;
cur = cur-&gt;xmlChildrenNode;
while (cur != NULL) {
if ((!xmlStrcmp(cur-&gt;name, (const xmlChar *)&quot;reference&quot;))) {
- <a name="getattributevalue"></a><img src="images/callouts/1.png" alt="1" border="0"> printf(&quot;uri: %s\n&quot;, xmlGetProp(cur, &quot;uri&quot;));
- }
+ <a name="getattributevalue"></a><img src="images/callouts/1.png" alt="1" border="0"> uri = xmlGetProp(cur, &quot;uri&quot;);
+ printf(&quot;uri: %s\n&quot;, uri);
+ xmlFree(uri);
+ }
cur = cur-&gt;next;
}
- return;
+ return;
}
</pre><p>
@@ -26,10 +29,10 @@ getReference (xmlDocPtr doc, xmlNodePtr cur) {
The key function is <tt><a href="http://xmlsoft.org/html/libxml-tree.html#XMLGETPROP" target="_top">xmlGetProp</a></tt>, which returns an
<tt>xmlChar</tt> containing the attribute's value. In this case,
we just print it out.
- </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th>Note</th></tr><tr><td colspan="2" align="left" valign="top"><p>
+ </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
If you are using a DTD that declares a fixed or
default value for the attribute, this function will retrieve it.
- </p></td></tr></table></div><p>
+ </p></div><p>
</p></td></tr></table></div><p>
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ar01s06.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ar01s08.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Writing Attribute </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Encoding Conversion</td></tr></table></div></body></html>