Changeset 4685

Show
Ignore:
Timestamp:
05/14/08 20:45:44 (7 months ago)
Author:
xmlhacker
Message:

updated to catch a failed attempt at loading the output as an XmlReader?, outputting the string result instead

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/nuxleus/Source/CodeSamples/Zorba_Test/Program.cs

    r4684 r4685  
    1515            ZorbaProcess process = new ZorbaProcess(); 
    1616            process.RunQuery(args[0]); 
    17             XmlReader xReader = process.GetXmlReader(); 
    18             do 
    19             { 
    20                 if(xReader.IsStartElement()) 
    21                     Console.WriteLine(xReader.ReadOuterXml()); 
    22             } while (xReader.Read()); 
     17            try { 
     18                XmlReader xReader = process.GetXmlReader(); 
     19                do { 
     20                    if (xReader.IsStartElement()) 
     21                        Console.WriteLine(xReader.ReadOuterXml()); 
     22                } while (xReader.Read()); 
     23            } catch { 
     24                Console.WriteLine(process.Output.ReadToEnd()); 
     25            } 
    2326        } 
    2427    }