<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Create XML document by GDL in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Create-XML-document-by-GDL/m-p/120648#M18403</link>
    <description>Hi Frank&lt;BR /&gt;
&lt;BR /&gt;
Depending on how you need your XML file formatted, the following code will create an xml file (a basic file with no schema). Remembering that xml is just fancy formatted text.&lt;BR /&gt;
&lt;BR /&gt;
Hope this helps&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!!-file path			&lt;BR /&gt;
fspec="C:\Your File Path\File Name.xml" 	&lt;BR /&gt;
&lt;BR /&gt;
!!-First write - note this uses Mode = WO	&lt;BR /&gt;
chx = open("text",fspec,"Separator='\t',Mode = WO,FULLPATH")&lt;BR /&gt;
OUTPUT chx, 1,1,"&amp;lt;Header 1&amp;gt;"&lt;BR /&gt;
OUTPUT chx,1,2,"	&amp;lt;Header 2&amp;gt;"&lt;BR /&gt;
close chx&lt;BR /&gt;
&lt;BR /&gt;
!!- Create the main part of the xml file - note we use Mode = WA (Write Append Here)&lt;BR /&gt;
!!- Loop into this sub routine as required&lt;BR /&gt;
gosub 'Write XML Body'&lt;BR /&gt;
&lt;BR /&gt;
!!-Finish off with this &lt;BR /&gt;
ch = open("text",fspec,"Separator='\t',Mode = WA,FULLPATH")&lt;BR /&gt;
OUTPUT ch,1,1," 	&amp;lt;/Header 2&amp;gt;"&lt;BR /&gt;
OUTPUT ch, 1,2,"&amp;lt;/Header 1&amp;gt;"&lt;BR /&gt;
close ch&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
end&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!!=========&lt;BR /&gt;
&lt;BR /&gt;
'Write XML Body':&lt;BR /&gt;
&lt;BR /&gt;
ch = open("text",fspec,"Separator='\t',Mode = WA,FULLPATH")&lt;BR /&gt;
	OUTPUT ch,1,1,"&amp;lt;Body 1&amp;gt;"&lt;BR /&gt;
	OUTPUT ch,1,2,"&amp;lt;Field 2&amp;gt;" + Parameter1 + "&amp;lt;/Field 2&amp;gt;"&lt;BR /&gt;
	OUTPUT ch,1,3,"&amp;lt;Field 3&amp;gt;" + Parameter2 + "&amp;lt;/Field 3&amp;gt;"&lt;BR /&gt;
	OUTPUT ch,1,4,"&amp;lt;Field 4&amp;gt;" + Parameter3 + "&amp;lt;/Field 4&amp;gt;"&lt;BR /&gt;
	OUTPUT ch,1,5,"&amp;lt;Field 5&amp;gt;" + Parameter4 + "&amp;lt;/Field 5&amp;gt;"&lt;BR /&gt;
	OUTPUT ch,1,6,"&amp;lt;Field 6&amp;gt;"&lt;BR /&gt;
	OUTPUT ch,1,7,Parameter5&lt;BR /&gt;
	OUTPUT ch,1,8,"&amp;lt;/Field 6&amp;gt;"&lt;BR /&gt;
	OUTPUT ch,1,9,"&amp;lt;Field 7&amp;gt;" + Parameter6 + "&amp;lt;/Field 7&amp;gt;"&lt;BR /&gt;
	OUTPUT ch,1,10,"&amp;lt;/Body 1&amp;gt;"&lt;BR /&gt;
close ch&lt;BR /&gt;
&lt;BR /&gt;
return</description>
    <pubDate>Tue, 26 Oct 2010 05:01:39 GMT</pubDate>
    <dc:creator>Ben Cohen</dc:creator>
    <dc:date>2010-10-26T05:01:39Z</dc:date>
    <item>
      <title>Create XML document by GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Create-XML-document-by-GDL/m-p/120647#M18402</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;The GDL documentation of the XML AddOn is quiet better than most of the GDL manual, but I struggle with creating an XML file out of an object. Has anyone a functionating example, which will introduce me and lead me around the AC crashes by using "Flush" an "NewElement"?&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 25 Oct 2010 23:21:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Create-XML-document-by-GDL/m-p/120647#M18402</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2010-10-25T23:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Create XML document by GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Create-XML-document-by-GDL/m-p/120648#M18403</link>
      <description>Hi Frank&lt;BR /&gt;
&lt;BR /&gt;
Depending on how you need your XML file formatted, the following code will create an xml file (a basic file with no schema). Remembering that xml is just fancy formatted text.&lt;BR /&gt;
&lt;BR /&gt;
Hope this helps&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!!-file path			&lt;BR /&gt;
fspec="C:\Your File Path\File Name.xml" 	&lt;BR /&gt;
&lt;BR /&gt;
!!-First write - note this uses Mode = WO	&lt;BR /&gt;
chx = open("text",fspec,"Separator='\t',Mode = WO,FULLPATH")&lt;BR /&gt;
OUTPUT chx, 1,1,"&amp;lt;Header 1&amp;gt;"&lt;BR /&gt;
OUTPUT chx,1,2,"	&amp;lt;Header 2&amp;gt;"&lt;BR /&gt;
close chx&lt;BR /&gt;
&lt;BR /&gt;
!!- Create the main part of the xml file - note we use Mode = WA (Write Append Here)&lt;BR /&gt;
!!- Loop into this sub routine as required&lt;BR /&gt;
gosub 'Write XML Body'&lt;BR /&gt;
&lt;BR /&gt;
!!-Finish off with this &lt;BR /&gt;
ch = open("text",fspec,"Separator='\t',Mode = WA,FULLPATH")&lt;BR /&gt;
OUTPUT ch,1,1," 	&amp;lt;/Header 2&amp;gt;"&lt;BR /&gt;
OUTPUT ch, 1,2,"&amp;lt;/Header 1&amp;gt;"&lt;BR /&gt;
close ch&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
end&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!!=========&lt;BR /&gt;
&lt;BR /&gt;
'Write XML Body':&lt;BR /&gt;
&lt;BR /&gt;
ch = open("text",fspec,"Separator='\t',Mode = WA,FULLPATH")&lt;BR /&gt;
	OUTPUT ch,1,1,"&amp;lt;Body 1&amp;gt;"&lt;BR /&gt;
	OUTPUT ch,1,2,"&amp;lt;Field 2&amp;gt;" + Parameter1 + "&amp;lt;/Field 2&amp;gt;"&lt;BR /&gt;
	OUTPUT ch,1,3,"&amp;lt;Field 3&amp;gt;" + Parameter2 + "&amp;lt;/Field 3&amp;gt;"&lt;BR /&gt;
	OUTPUT ch,1,4,"&amp;lt;Field 4&amp;gt;" + Parameter3 + "&amp;lt;/Field 4&amp;gt;"&lt;BR /&gt;
	OUTPUT ch,1,5,"&amp;lt;Field 5&amp;gt;" + Parameter4 + "&amp;lt;/Field 5&amp;gt;"&lt;BR /&gt;
	OUTPUT ch,1,6,"&amp;lt;Field 6&amp;gt;"&lt;BR /&gt;
	OUTPUT ch,1,7,Parameter5&lt;BR /&gt;
	OUTPUT ch,1,8,"&amp;lt;/Field 6&amp;gt;"&lt;BR /&gt;
	OUTPUT ch,1,9,"&amp;lt;Field 7&amp;gt;" + Parameter6 + "&amp;lt;/Field 7&amp;gt;"&lt;BR /&gt;
	OUTPUT ch,1,10,"&amp;lt;/Body 1&amp;gt;"&lt;BR /&gt;
close ch&lt;BR /&gt;
&lt;BR /&gt;
return</description>
      <pubDate>Tue, 26 Oct 2010 05:01:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Create-XML-document-by-GDL/m-p/120648#M18403</guid>
      <dc:creator>Ben Cohen</dc:creator>
      <dc:date>2010-10-26T05:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create XML document by GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Create-XML-document-by-GDL/m-p/120649#M18404</link>
      <description>Thanks Ben, but this is only plan b. I know, that it is just a special formatted text file, but in your example I have to handle the whole structure and syntax by myself.&lt;BR /&gt;
&lt;BR /&gt;
What  I want is to open/create the XML file directly by the XML AddOn. I can create it in this way yet, but not more than the root node so far. Creating a child node causes AC crashes. It looks like I am doing something GS programmers haven't thought of somebody could do.</description>
      <pubDate>Tue, 26 Oct 2010 06:35:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Create-XML-document-by-GDL/m-p/120649#M18404</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2010-10-26T06:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create XML document by GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Create-XML-document-by-GDL/m-p/120650#M18405</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Frank tracked down a bug in the GDL XML output. I fixed it and the fix will get into Hotfix 2. More exactly, any version after build 3467 in AC14 and in all later main AC versions of course.&lt;BR /&gt;
&lt;BR /&gt;
Until these versions get published, you're left with Ben's idea using simple text output instead:(&lt;BR /&gt;
&lt;BR /&gt;
Sorry for the hassle,</description>
      <pubDate>Wed, 10 Nov 2010 09:25:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Create-XML-document-by-GDL/m-p/120650#M18405</guid>
      <dc:creator>ztaskai</dc:creator>
      <dc:date>2010-11-10T09:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Create XML document by GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Create-XML-document-by-GDL/m-p/120651#M18406</link>
      <description>Does it affect the GDL webcontrol too?</description>
      <pubDate>Wed, 10 Nov 2010 15:45:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Create-XML-document-by-GDL/m-p/120651#M18406</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2010-11-10T15:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create XML document by GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Create-XML-document-by-GDL/m-p/120652#M18407</link>
      <description>Yes. It uses the same add-on. I don't know the release and update schedule of v14 WebControl but I don't think this fix will trigger a new hotfix for webcontrol...</description>
      <pubDate>Thu, 11 Nov 2010 18:22:16 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Create-XML-document-by-GDL/m-p/120652#M18407</guid>
      <dc:creator>ztaskai</dc:creator>
      <dc:date>2010-11-11T18:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Create XML document by GDL</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Create-XML-document-by-GDL/m-p/120653#M18408</link>
      <description>&lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_sad.gif" style="display : inline;" /&gt; &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_sad.gif" style="display : inline;" /&gt;&lt;BR /&gt;
&lt;BR /&gt;
That's the environment I need it for. Writing values out of an object in webcontrol.</description>
      <pubDate>Thu, 11 Nov 2010 23:01:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Create-XML-document-by-GDL/m-p/120653#M18408</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2010-11-11T23:01:08Z</dc:date>
    </item>
  </channel>
</rss>

