Hi,

as we know 

ethercat -xml

produces XML output. Unfortunately, if there is more than one device
attached, it's not just one single document but a list of documents,

I'm planning to use that XML output for testing the software
without the hardware and even without the ec_master module.

I could easily write another tool for filtering that multiple
<?xml>-lines out and writing another tag around the list.

But wouldn't it better to have just one single document?

The name could be EtherCATInfoList for example, any better names?

And attached there's a little patch for the file
''tool/CommandXml.cpp'', which would solve that. The patch works from
Version 1.4 up to devel-r1713.

What do you think about?

Regards,
        Erwin
-- 
Erwin Burgstaller
--- CommandXml.cpp.orig 2009-03-19 09:43:05.000000000 +0100
+++ CommandXml.cpp      2009-04-24 11:06:36.425183000 +0200
@@ -82,9 +82,16 @@
     m.open(MasterDevice::Read);
     slaves = selectedSlaves(m);
 
+    cout
+        << "<?xml version=\"1.0\" ?>" << endl
+        << "<EtherCATInfoList>" << endl;
+    
     for (si = slaves.begin(); si != slaves.end(); si++) {
         generateSlaveXml(m, *si);
     }
+
+    cout
+       << "</EtherCATInfoList>" << endl;
 }
 
 /****************************************************************************/
@@ -101,7 +108,6 @@
     unsigned int i, j, k;
     
     cout
-        << "<?xml version=\"1.0\" ?>" << endl
         << "  <EtherCATInfo>" << endl
         << "    <!-- Slave " << slave.position << " -->" << endl
         << "    <Vendor>" << endl
@@ -202,8 +208,8 @@
 
     cout
         << "        </Device>" << endl
-        << "     </Devices>" << endl
-        << "  </Descriptions>" << endl
-        << "</EtherCATInfo>" << endl;
+        << "      </Devices>" << endl
+        << "    </Descriptions>" << endl
+        << "  </EtherCATInfo>" << endl;
 }
 /*****************************************************************************/
_______________________________________________
etherlab-dev mailing list
[email protected]
http://lists.etherlab.org/mailman/listinfo/etherlab-dev

Reply via email to