Note that there are some explanatory texts on larger screens.

plurals
  1. POParse XML File C++ using TinyXML
    primarykey
    data
    text
    <p>I have an xml File This file is composed of Blocks, Lines, words, characters:</p> <pre><code> &lt;block id="48" left="2532" top="108" right="2896" bottom="137"&gt; &lt;line id="49" left="2532" top="108" right="2896" bottom="137"&gt; &lt;word id="50" left="2532" top="108" right="2616" bottom="137" value='Date&amp;quot;d&amp;apos;' confidence="69" font="MP" type="-1"&gt; &lt;char id="51" left="2532" top="115" right="2550" bottom="137" value="D" confidence="92" /&gt; &lt;char id="52" left="2551" top="120" right="2565" bottom="137" value="a" confidence="51" /&gt; &lt;char id="53" left="2566" top="116" right="2574" bottom="137" value="t" confidence="33" /&gt; &lt;char id="54" left="2574" top="120" right="2589" bottom="136" value="e" confidence="100" /&gt; &lt;char id="55" left="2589" top="108" right="2592" bottom="112" value='&amp;quot;' confidence="39" /&gt; &lt;char id="56" left="2597" top="115" right="2611" bottom="136" value="d" confidence="76" /&gt; &lt;char id="57" left="2612" top="115" right="2616" bottom="123" value="&amp;apos;" confidence="100" /&gt; &lt;/word&gt; </code></pre> <ul> <li>Every Block is composed of 1,...,n Lines</li> <li>Every line is composed of 1,...,k words</li> <li>Every word is composed of 1,...,l characters</li> </ul> <p>I am trying to create objects as follows:</p> <pre><code>Block(int top, int left, int bottom, int right, vector&lt;Lines&gt;) Line(int top, int left, int bottom, int right, vector&lt;words&gt;) Word(int top, int left, int bottom, int right, vector&lt;characters&gt;) </code></pre> <p>I am using TinyXML on C++, but i can't link them together, My code can take one object( block,line,word,character) at a time.</p> <pre><code>void Keywords::checkChild(TiXmlElement *child) { if(child) { if((string)child-&gt;Value() == "block") { cout &lt;&lt; child-&gt;Value()&lt;&lt;endl; double x1 = atoi(child-&gt;Attribute("left")); double y1 = atoi(child-&gt;Attribute("top")); double x2 = atoi(child-&gt;Attribute("right")); double y2= atoi(child-&gt;Attribute("bottom")); int bid = atoi(child-&gt;Attribute("id")); double xcenter = (x1 + x2)/2.0; double ycenter = (y1 + y2)/2.0; double hauteur = y2-y1; double largeur = x2-x1; //LineList is a vector, and I can't find a way to fill the vector // blockList.push_back(new Block(y1,x1,y2,x2,xcenter,ycenter,largeur,hauteur,xmlFile,lineList)); } checkChild(child-&gt;FirstChildElement()); checkChild(child-&gt;NextSiblingElement()); }///end if child } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload