﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3ASource%2FDevelopment%2FProjects%2FBlender_File_Format%2FXML%2FTreeEditingFunctions</id>
	<title>Dev:Source/Development/Projects/Blender File Format/XML/TreeEditingFunctions - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3ASource%2FDevelopment%2FProjects%2FBlender_File_Format%2FXML%2FTreeEditingFunctions"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Source/Development/Projects/Blender_File_Format/XML/TreeEditingFunctions&amp;action=history"/>
	<updated>2026-07-13T21:37:57Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:Source/Development/Projects/Blender_File_Format/XML/TreeEditingFunctions&amp;diff=43158&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Source/Development/Projects/Blender_File_Format/XML/TreeEditingFunctions&amp;diff=43158&amp;oldid=prev"/>
		<updated>2018-06-28T17:45:49Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2018年6月28日 (木) 17:45時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Yamyam</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:Source/Development/Projects/Blender_File_Format/XML/TreeEditingFunctions&amp;diff=43157&amp;oldid=prev</id>
		<title>wiki&gt;Mindrones bot: Robot: Automated text replacement  (-[[dev: +[[Dev:)</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:Source/Development/Projects/Blender_File_Format/XML/TreeEditingFunctions&amp;diff=43157&amp;oldid=prev"/>
		<updated>2010-05-27T19:59:15Z</updated>

		<summary type="html">&lt;p&gt;Robot: Automated text replacement  (-[[dev: +[[Dev:)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= XMLTreeEditingFunctions=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;&amp;lt;hr&amp;gt;[[Dev:Source/Development/Projects/Blender File Format/XML/SourceCode|Back]]&amp;lt;hr&amp;gt;   [[Dev:Source/Development/Projects/Blender File Format/XML|home]]   &amp;lt;hr&amp;gt;[[Dev:Source/Development/Projects/Blender File Format/XML/TreeNavigationFunctions|Next]]&amp;lt;hr&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tree Editing Code==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
xml_object *XML_create_tag(char *name, int content_type, char *content) &lt;br /&gt;
{ xml_object *xml;  xml = MEM_callocN(sizeof(xml_object), &amp;quot;xml&amp;quot;);  strcpy(xml-&amp;gt;tagName, name); xml-&amp;gt;contentType = content_type; strcpy(xml-&amp;gt;content, content);  return xml;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
xml_doc *XML_create_doc(char *name) &lt;br /&gt;
{ /* create the root tag object and set the cursor to it */ xml_doc *doc; xml_object * xml;  xml = XML_create_tag(name, 0, &amp;quot;&amp;quot;); doc = MEM_callocN(sizeof(xml_doc), &amp;quot;doc&amp;quot;);  doc-&amp;gt;root = xml; doc-&amp;gt;cursor = xml;  return doc;   &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* tree editing functions */&lt;br /&gt;
int XML_insert_tag(xml_doc *doc, int place, xml_object *tag)&lt;br /&gt;
{ xml_object *xmlCursor = doc-&amp;gt;cursor;&lt;br /&gt;
 /* test for Document root and react accordingly. */ if (doc-&amp;gt;root == doc-&amp;gt;cursor) { /* we are at the document root */ /* insert the tag  Personal note: use BLI_addtail(doc-&amp;gt;cursor-&amp;gt;parent-&amp;gt;child_list, tag) or BLI_addhead for adding to a list - jeremy*/ if (xmlCursor-&amp;gt;child_list.first == 0) { /* has no children */ xmlCursor-&amp;gt;child_list.first = tag; xmlCursor-&amp;gt;child_list.last = tag; } else { BLI_addtail(xmlCursor-&amp;gt;child_list, tag); }  } else { /* check whether we are inserting tag before or after */ if (place == 1) { /* inserting after */ BLI_insertlink(xmlCursor-&amp;gt;parent-&amp;gt;child_list, xmlCursor, tag);  } else { /* inserting before */ BLI_insertlinkbefore(xmlCursor-&amp;gt;parent-&amp;gt;child_list, xmlCursor, tag); }  } tag-&amp;gt;parent = xmlCursor-&amp;gt;parent; /* set the tags parent */ doc-&amp;gt;cursor = tag; /* set the cursor to the added tag */  return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void XML_insert_child(xml_doc *doc, xml_object *tag)&lt;br /&gt;
{ BLI_addtail(doc-&amp;gt;cursor-&amp;gt;child_list, tag); /* insert the tag at the end of the child list */  tag-&amp;gt;parent = doc-&amp;gt;cursor; doc-&amp;gt;cursor = tag;/* set cursor to the inserted tag */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int remove_children(xml_object *tag) &lt;br /&gt;
{    xml_object *child; ListBase *child_list = &amp;amp;tag-&amp;gt;child_list;  /* test for children */ if (child_list-&amp;gt;first) { child = tag-&amp;gt;child_list.first; /* loop through children */ while (child) { /* for each child test for children if it has children   call remove_children for that child. */ if (child-&amp;gt;child_list.first) {   if (remove_children(child))       return 0; } BLI_remlink(child_list, child); MEM_freeN(child); }  } return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int XML_remove_tag(xml_doc *doc, xml_object *tag)&lt;br /&gt;
{ /* check for children */ if (tag-&amp;gt;child_list.first) { /* remove all children recursively */ if (remove_children(tag)) { printf(&amp;quot;Failed to remove %s's Children in function XML_remove_tag&amp;quot;, tag-&amp;gt;tagName); return 0; } } /* check to see if tag is root */ if (doc-&amp;gt;root == tag) { doc-&amp;gt;cursor = NULL; doc-&amp;gt;root = NULL; } else { /* set cursor to the previous tag or parent */ doc-&amp;gt;cursor = tag-&amp;gt;parent; }  /* remove curent tag */ if (tag-&amp;gt;prop_list.first) BLI_freelistN(tag-&amp;gt;prop_list); BLI_remlink(tag-&amp;gt;parent-&amp;gt;child_list, tag); /* remove tag from list document */ MEM_freeN(tag); /* free memory used by tag */ return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/* Tag editing functions and reading functions */&lt;br /&gt;
char *XML_get_current_content(xml_doc *doc)&lt;br /&gt;
{ char content[128];  strcpy(content, doc-&amp;gt;cursor-&amp;gt;content);  return content;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int XML_set_current_content(char *content, xml_doc *doc)&lt;br /&gt;
{ if (strlen(content) &amp;lt; 128) {  strcpy(doc-&amp;gt;cursor-&amp;gt;content, content);  return 1; } else { return 0; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
xml_property *XML_get_current_proplist(xml_doc *doc)&lt;br /&gt;
{ xml_property *property;  doc-&amp;gt;cursor-&amp;gt;prop_list.first = property;  return property;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int XML_insert_property(char *propName, char *value)&lt;br /&gt;
{ xml_property *property; property = MEM_callocN(sizeof(xml_property), &amp;quot;property&amp;quot;);  if (strlen(propName) &amp;lt; 32) {  strcpy(property-&amp;gt;propName, propName); return 1; } else { return 0; } if (strlen(propName) &amp;lt; 128) { strcpy(property-&amp;gt;value, value); return 1; } else { return 0; } &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;&amp;lt;hr&amp;gt;[[Dev:Source/Development/Projects/Blender File Format/XML/SourceCode|Back]]&amp;lt;hr&amp;gt;   [[Dev:Source/Development/Projects/Blender File Format/XML|home]]   &amp;lt;hr&amp;gt;[[Dev:Source/Development/Projects/Blender File Format/XML/TreeNavigationFunctions|Next]]&amp;lt;hr&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-- [[BlenderDev/DeveloperWikiJeremyWall|DeveloperWikiJeremyWall]] - 11 Dec 2004&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>wiki&gt;Mindrones bot</name></author>
		
	</entry>
</feed>