[etherlab-dev] Xml output of ethercat (tool)

Erwin Burgstaller ethercat.berknapp at spamgourmet.com
Mon Jun 15 08:51:02 CEST 2009


Hi!

What's about that patch now? I'm counting on it. ;-)

As already written, the ethercat tool would always output valid XML with
it. 

Without the patch, the command "ethercat xml" does not produce an
output which goes through any xml parser, so it's pretty useless.


* Mon, Apr 27, 2009 - 13:59:29 +0200, Erwin Burgstaller:

> --- /tmp/ethercat-devel-r1718/tool/CommandXml.cpp	2009-03-19 09:43:05.000000000 +0100
> +++ CommandXml.cpp	2009-04-27 12:34:32.954471517 +0200
> @@ -82,9 +82,18 @@
>      m.open(MasterDevice::Read);
>      slaves = selectedSlaves(m);
>  
> +    cout << "<?xml version=\"1.0\" ?>" << endl;
> +    if (slaves.size() > 1) {
> +        cout << "<EtherCATInfoList>" << endl;
> +    }
> +
>      for (si = slaves.begin(); si != slaves.end(); si++) {
>          generateSlaveXml(m, *si);
>      }
> +
> +    if (slaves.size() > 1) {
> +        cout << "</EtherCATInfoList>" << endl;
> +    }
>  }
>  
>  /****************************************************************************/
> @@ -101,7 +110,6 @@
>      unsigned int i, j, k;
>      
>      cout
> -        << "<?xml version=\"1.0\" ?>" << endl
>          << "  <EtherCATInfo>" << endl
>          << "    <!-- Slave " << slave.position << " -->" << endl
>          << "    <Vendor>" << endl
> @@ -202,8 +210,8 @@
>  
>      cout
>          << "        </Device>" << endl
> -        << "     </Devices>" << endl
> -        << "  </Descriptions>" << endl
> -        << "</EtherCATInfo>" << endl;
> +        << "      </Devices>" << endl
> +        << "    </Descriptions>" << endl
> +        << "  </EtherCATInfo>" << endl;
>  }
>  /*****************************************************************************/

Regards,

	Erwin

-- 
Erwin Burgstaller



More information about the Etherlab-dev mailing list