The two biggest Mideast crises this past week, concerning Egypt and Palestine, involved voting.

Given the bloodshed elsewhere in the region, I consider that to be progress.

On Thursday, the U.N. General Assembly voted overwhelmingly to upgrade Palestine to nonmember state observer status (the vote was 138 in favor, with 41 abstentions, and only nine opposed, including the United States, Canada, and Israel). This vote was a positive, since it reenshrines the principle of two separate states for Israel and the Palestinians at a time when fundamentalists on both sides say there should be only one state between the Jordan River and the Mediterranean. Down that road lies the end of the Jewish, democratic state.

The vote in Egypt worries me more. On Friday, the Islamist-dominated body charged with drafting Egypt's new constitution approved a problematic document over the vehement objections of non-Islamists, whose representatives boycotted the balloting. The battle over Egypt's identity has now returned to the streets.

Egypt's President Mohammed Morsi, a man of the Muslim Brotherhood, seized nearly absolute power last month when he issued a decree putting himself above the judiciary. He feared that a high court was about to dissolve the constitutional assembly on the basis that its selection was illegal. He said his decree was temporary until the draft charter is put to a popular vote Dec. 15.

But as a result, many of the country's judges are on strike. And Morsi has managed to unify a disorganized opposition of secularists, leftists, moderate Muslims, and Tahrir Square revolutionary youths, who are now demonstrating against him.

Now the struggle for Egypt - and the test of whether the Arab world's largest country can move toward democracy - boils down to whether the Egyptian leader can grasp that he can't ram things through as if he were an old-style dictator.

The good news is that once-passive Egyptians have become so politicized, they won't let a leader behave like a pharaoh. On something as critical as the new constitution, Morsi must seek a political consensus.

The sobering news: If some form of democracy is to emerge, Islamists must find a basis for compromise with non-Islamists. Given the deep lack of trust between the camps, that will be far, far harder than getting tea-party Republicans to deal with Democrats.

"Our struggle is to get a proper constitution that guarantees freedom of religion and freedom from fear, and a proper balance of power," I was told last month in Cairo by Mohammed ElBaradei, a former high U.N. official and key opposition leader. "The Muslim Brotherhood hasn't tried to reach out to the rest of the country. Will they side with the commonsense people and focus on real issues or take extreme views?"

To be fair, I believe Morsi's controversial decree stemmed more from economic desperation than a desire to impose his Islamic ideology. Egypt's economy is in deep trouble, with tourism and foreign investment way down. If he can't deliver jobs and growth soon, his party will falter in the next elections.

The country cannot stabilize until those elections are held, which cannot legally happen until after the constitutional referendum. So Morsi was desperate to speed up the political process, and behaved like a traditional Egyptian leader - acting by fiat. But he misjudged the reaction at home.

The root of Morsi's problem can be traced to the makeup of the constitutional assembly. His party insisted it should reflect the result of parliamentary elections, which gave three-quarters of the seats to Muslim Brotherhood or Salafi candidates. Yet the Brotherhood's popularity dipped in the months after that election, and Morsi got only 51.7 percent of the presidential vote.

In a divided country, the constitutional drafting body should have been far more inclusive. "The body was not seen as representative nor was the process transparent," says Hossam Bahgat, head of the Egyptian Initiative for Personal Rights. Its makeup fueled fears that the Brotherhood wanted a document that would cement its hold on power.

Non-Islamists on the drafting team did manage to push back many worrisome provisions. Salafis wanted to stipulate that all laws must be in accord with the "rules" of sharia law rather than retain a vaguer phrasing that refers to the "principles" of sharia. The Salafis lost. The drafters also rejected Salafi efforts to limit women's equality by making them subject to sharia rules.

Critics say the final draft still provides inadequate protection of freedom of expression and religion, gives the president too much power, and fails to extend civilian control over the military. It lacks the credibility that can only be conferred by an open and fair process.

That said, the opposition also shares blame for the standoff. A key reason the Islamists did so well at the polls is that opposition groups failed to unify against them. Galvanized by Morsi's mistakes, opposition leaders are now coalescing into a "National Front," which will no doubt also receive support from backers of the ousted Mubarak regime.

But this new coalition won't succeed merely by boycotts or driving Egypt's economy further toward disaster. Nor can it win merely by massing its followers over and over in Tahrir Square.

In the new Egypt, the non-Islamist opposition must learn the art of tough political negotiating. It must also convince voters - all over Egypt - that its leaders have more to offer than the Brotherhood. One hopes this crisis will teach Morsi some crucial lessons about democratic politics. The big question: Will the opposition learn something, too?

E-mail Trudy Rubin