@esodan
You asked me to create a new discussion.
I would like to clarify that the first goal for me is to create a visualization of a universal XML document, not specifically .UI GTK. And only then adding such features as packages, with which you can use DnD to create new XML documents(From a pre-prepared set(gtk widgets)) from scratch(I also have some ideas about the possibility of adding custom scripts, for example, to visualize the result like glade)
The collections you provided will make it very easy to create packages that I described on Twitter. But now I still have an unresolved question, I’ll just move it here.
Hi, have a small question. I’m just playing with GXML for now. Just made bfs:
var g = new GXml.Document.from_file (f);
var q = new Gee.LinkedList<DomNode>();
var temp = new Gee.ArrayList<DomNode>();
q.add(g);
while (!q.is_empty) {
while (!q.is_empty) {
prin("current level length: ", q.size);
prin("deleted node: ", q.peek().node_name, " : ",q.peek().text_content!=null?q.peek().text_content:"no content");
temp.add_all(q.poll().child_nodes);
}
q.add_all(temp);
temp.clear();// можно наверно оптимизировать сделав temp стаком
}
Testing on this example
<A>
<B>
<D>d_content</D>
<E>e_content</E>
</B>
<C>
c_content
</C>
</A>
I get the following output:
current level length: 1
deleted node: #document : no content
current level length: 1
deleted node: A :
current level length: 5
deleted node: #text : no content
current level length: 4
deleted node: B :
current level length: 3
deleted node: #text : no content
current level length: 2
deleted node: C :
c_content
current level length: 1
deleted node: #text : no content
current level length: 6
deleted node: #text : no content
current level length: 5
deleted node: D : d_content
current level length: 4
deleted node: #text : no content
current level length: 3
deleted node: E : e_content
current level length: 2
deleted node: #text : no content
current level length: 1
deleted node: #text : no content
current level length: 2
deleted node: #text : no content
current level length: 1
deleted node: #text : no content
I didn’t expect to get these starting with # nodes. I roughly understand what it is(or not xd), but I did not think that they will come back from the child_nodes()
method. Is there a way to avoid them, or might they be needed(I’m not an expert in XML). Now I assume that I will just do filtering on the first character when I redo everything on gpseq.