Design forum
cancel
Showing results for 
Search instead for 
Did you mean: 

GDL XML Extension

GDL_Masters
Newcomer
Can anybody help me with the GDL XML Extension? I'm trying to decode it since 4 days and i have no idea how it works! The ArchiCAD 9 documentation is very confusing or i'm so stupid

I'm trying to teach my GDL how to output data like dimensions and price in a XML file so i can read it with an JAVA script. My Problem i have no idea how the GDL XML syntax works!

The best for me would be to download a GDL objekt where this GDL XML Extension script is use so i can whatch how to write it!
http://www.gdl-masters.eu
11 REPLIES 11

F_ Beister
Newcomer
Have you read the XML-AddOn documentation in the GDL manual? Where is your problem exactly? What works, what doesn't? Have you written yet an example one could look at to see your eventually mistake?

GDL_Masters
Newcomer
I have already read the GDL Documentation from Graphisoft but i dont check it.

My problem is:
1. This is my script for the channel
ch7 = Open ("XML", "G:/opt.xml", "wf")

2. I try to write something in the XML File. Exactly this is the biggest problem i dont have any idea how the GDL syntax works! The first command OUTPUT is very simple then i tell him the channel but the next command is the problem. In the GDL Documentation is written that i have to tell him a fieldID but what does this mean there is nothing in the Document so i can't give him a fieldID.

OUTPUT ch7, "NewComment insertpos","1","<!-- the comment itself -->"

3. Close the channel
CLOSE ch7

Later i like to read the data in the XML Object with the INPUT command and copy them and write the new data and the "old" in the same XML Object.

But first its important for me to write anything in the XML Object that i know how the command works!

I hope you understand me now!
http://www.gdl-masters.eu

F_ Beister
Newcomer
Have you used the CreateDocument command at first, as written in the manual?
'w': [...] (Nach dem Befehl OPEN muss die Anweisung CreateDocument die erste ausgeführte Anweisung sein.)
Will be created the file on the hd? It will be empty, but does it exist? If not, try it without the path name.

Are you familiar with the XML format? The ID will probably be the position of the data-nodes (?).

F_ Beister
Newcomer
As it was told to you in the german talk you should first do some steps with the text i/o or the data i/o to get a feeling for the handling of external files, path names etc. The manual according to the XML AddOn does not seem as bad to me. 😉 But my knowledge of the XML-structure is more theroretical, too.

Why can't you read a dump text or database-file from JavaScript?

GDL_Masters
Newcomer
I dont used this command because i creat a new document with the 'w' on the HD. An that is my only sucess on this project that he make a new document. I can try it but there is the next problem what should i write in this command when the fieldID is ignored?

OUTPUT ch7, "CreateDocument","","opt"
or
OUTPUT ch7, "CreateDocument","opt"

I know that the fielID is a position in the XML document but he makes a clear document and then i haven't a position to tell him.

I can send you my GDL object maybe you have a idea how to make it.
http://www.gdl-masters.eu

F_ Beister
Newcomer
CreateDocument ist nur zulässig, wenn die Datei im Modus "Neue Datei" oder "Überschreiben" geöffnet wurde. In diesen Modi muss diese Anweisung zuerst ausgeführt werden, um das XML-Dokument zu erstellen.
Unexpected clear explanation in the manual. OPEN file and OUTPUT "CreateDocument". If it makes sense for you is not the question. It's the syntax.

The first one, I guess is right. The parameter is described as "ignored", but not as "not expected" (as i some other commands in GDL too).

GDL_Masters
Newcomer
insertpos kann folgendes sein::
AsNextSibling: Das neue Element wird nach der in fieldID angegebenen Position eingefügt
AsPrevSibling: Das neue Element wird vor der in fieldID angegebenen Position eingefügt
AsFirstChild: Das neue Element wird als erstes untergeordnetes Element des in fieldID (muss ein Elementknoten sein) angegebenen Knotens eingefügt
AsLastChild: Das neue Element wird als letztes untergeordnetes Element des in fieldID (muss ein Elementknoten sein) angegebenen Knotens eingefügt
Yes it is right the syntax is my problem how to write the hole shi.......t

In every command there is that word insertpos an i read that this word have a meaning (see at the Quote). I think i have a mistake in my syntax when i try to write something in the XML File because he makes a new document and then i get an error like "Syntax Fehler" and "Dateibearbeitungsfehler".

Do you have a example for me how to write this NewComment command?
http://www.gdl-masters.eu

GDL_Masters
Newcomer
I have another success he makes a new document an write something in it. I'm really happy about this because i'm sitting for 4 days on this problem. My mistake was the command CreateDocument but my next problem is to tell him the fieldID when i like to write something in the document with the OUTPUT command.
http://www.gdl-masters.eu

F_ Beister
Newcomer
The fieldID will be the name of a node. I think, that it will create a XML tag. XML is an object orientaded data model. You have to declare a node and then you can assign a value to it. To "talk" or "read from" a certain node, you have to identify it by its name. As you do in text i/o to use the column number of the actual row.
Again my question: Are you familiar with the XML format? Do you have an aim of export format/structure? Can you create such an file "by hand" and post it?

GDL_Masters
Newcomer
Again my question: Are you familiar with the XML format? Do you have an aim of export format/structure? Can you create such an file "by hand" and post it?
Not exactly me but a Teammate is very good in those things. He makes our websites and other things with HTML/PHP/JAVA/XML. My part of this project is to "learn" to write the GDL object an he makes the JAVA programm to read the hole data.

I also think that i have to tell him a node but how? I can define a node with an Number (like 00 or 01) or with a Name. The two things are possible but in the GDL Documentation is nothing explained how to use this command.
http://www.gdl-masters.eu

Cosminn
Newcomer
Hello to all.
I need an add on to open, read and modify a document "xml", or have to write a script into a new object.
------------------------------------------------------------
AC24
•Workstation HP Z800 2 x Intel Xeon Quad Core E5620/E5630, 36 GB ram DDR3 - NVIDIA QUADRO 4000 2 GB memory, Windows 10 pro

Didn't find the answer? Start a new discussion

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!