[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Heterogeneous XML editing environments - how do youcope?

  • From: Jonathan Robie <jonathan.robie@r...>
  • To: rob@k...
  • Date: Wed, 17 Oct 2007 17:33:24 -0400

Re:  Heterogeneous XML editing environments - how do youcope?
Robert Koberg wrote:
>>> If I had a tool that would reliably pretty-print the XML source without 
>>> trashing any important whitespace formatting,
>>>       
>
> tomaytoe, tamahtoe, solanum lycopersicum
>
> Is whitespace like this important:
>
> <p>blah blah
> blah blah blah
> blah blah</p>
>
> ? Doesn't it seem incorrect? But it's probably nice for the vi/emacs
> user. But why use stone tablets?
>   

Not sure I get your drift. When you're writing technical documentation 
with source code fragments, whitespace matters. Whitespace *is* 
significant here:

int main() {
    Connection connection;
    Message msg;
    try {
      connection.open("127.0.0.1", 5672);
      Session session =  connection.newSession();

  //--------- Main body of program 
--------------------------------------------

      //  Subscribe to the queue, route it to a client destination for
      //  the listener.

      session.messageSubscribe_(queue="message_queue", 
destination="listener_destination");

      //  Tell the listener to listen to the destination we just
      //  created above.

      Listener listener(session, "listener_destination");
      listener.listen();

  
//-----------------------------------------------------------------------------

      connection.close();
      return 0;
    } catch(const std::exception& error) {
        std::cout << error.what() << std::endl;
    }
    return 1;  
}


Most users don't want to see this, and it no longer compiles because the 
// comments rely on end of lines:

int main() { Connection connection; Message msg;  try { 
connection.open("127.0.0.1", 5672);  Session session =  
connection.newSession();  //--------- Main body of program 
--------------------------------------------  //  Subscribe to the 
queue, route it to a client destination for //  the listener.  
session.messageSubscribe_(queue="message_queue", 
destination="listener_destination");  //  Tell the listener to listen to 
the destination we just //  created above. Listener listener(session, 
"listener_destination"); listener.listen(); 
//----------------------------------------------------------------------------- 
connection.close(); return 0; } catch(const std::exception& error) 
{std::cout << error.what() << std::endl; } return 1;  }


Whitespace may be less significant for tomatoes than it is for source 
code listings.

Jonathan


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.