Stocks were little changed in choppy, light trading on Wednesday as investors weighed high expectations about an upcoming euro zone summit against headline-driven selling.

An agreement earlier in the week between Germany and France on tighter fiscal controls for the euro zone, to be voted on Friday, prompted buying.

But expectations may have gone too far, analysts said. Comments on Wednesday from an unnamed German official that Berlin was increasingly pessimistic about the chances of a deal during the summit kept trading choppy.

The market has been resilient and bearish developments, including Standard & Poor's euro zone credit rating downgrade warning on Monday, failed to trigger massive selling.

I think the hopes (for a deal in the summit) are certainly still there. There's a belief in the marketplace that the euro zone doesn't have a death wish, said Art Hogan, managing director at Lazard Capital Markets in New York.

There is today's news and we started the week with S&P threatening to downgrade. In another time the market would be down much more than it is.

The S&P 500 is so far this week holding on to the gains posted on Monday.

Trading volume was very light, characteristic of the wait-and-see mode Hogan described ahead of the summit.

The Dow Jones industrial average <.DJI> gained 22.78 points, or 0.19 percent, to 12,172.91. The Standard & Poor's 500 <.SPX> dipped 1.21 points, or 0.10 percent, to 1,257.26. The Nasdaq Composite <.IXIC> fell 5.25 points, or 0.20 percent, to 2,644.31.

Equities and other markets have hinged on euro zone sovereign debt crisis headlines for weeks. Traders are looking to position themselves ahead of an escalation of the crisis or a clear, manageable plan to keep it under control.

French officials said French and German leaders will not leave the weekend summit until a powerful deal was reached. They want to impose mandatory penalties on nations that exceed deficit targets, a plan backed by U.S. Treasury Secretary Timothy Geithner, who is on a trip to Europe.

Among individual stocks, Martha Stewart Living Omnimedia Inc jumped 28.8 percent to $4.02 after JC Penney Co agreed to buy a 16.6 percent stake.

Men's Wearhouse Inc's shares jumped 16.8 percent to $31.77 a day after the clothing retailer reported quarterly profit that topped expectations.

Declining stocks outnumbered advancers on the New York Stock Exchange by a ratio of about 6-to-5, while on the Nasdaq, about five stocks fell for every three that rose.

(Reporting by Rodrigo Campos; editing by Jeffrey Benkoe and Andrew Hay)