HONG KONG'S 1997 transition from British to Chinese rule has suddenly become rockier. A victory of pro-democracy candidates to the territory's first fully elected legislature this week has put China on the defensive, revealing that it still has a long way to go in winning the hearts of Hong Kong people, and less than two years to do it. Embolden by their victory, some Democrats may deliberately provoke China, either by trying to reopen transition issues already settled with Britain, such as the composition of the territory's highest court. Having effectively lost the election, Beijing's actions toward the new legislature are expected to yield new clues on how it will govern the territory. ''China should be troubled by the results,'' said political analyst Andy Ho. ''The Democrats didn't do well [just] because they have so much support - many people were simply voting against China, [which] has been very high-handed.'' A colossal election-day blunder by China drove already-wary Hong Kong voters to give pro-democracy forces a sweeping victory. Democrats, allies, and like-minded independents won 17 of the legislature's 20 geographic seats. On the eve of last Sunday's elections for the Legislative Council (LegCo), Beijing issued a blunt reminder that China would disband the legislature come July 1, 1997. That warning boosted the win for the Democratic Party. The Democrats had been expected to do well, but not quite so well. With memories of the June 1989 Tiananmen Square massacre receding and the handover to China coming soon, it was thought that voters might find connections to Beijing a desirable attribute in a politician. To woo votes, most of the pro-Beijing candidates promised not to sit in this provisional legislature after 1997 if they were defeated last Sunday. So when it comes time for China to appoint a new legislature, it will be harder to find people to serve with at least some accountability to the people or sense of legitimacy. Moreover, in January Beijing is expected to appoint a preparatory committee to handle the transition after 1997. ''If the election results had been more favorable, Beijing might have been inclined to choose at least some 'moderate' Democrats,'' analyst Ho says. ''Now it is likely to be more careful about who it chooses and will appoint only people who can be trusted.'' The election also pushes Britain to more closely follow the people's will in its departing colony. Despite real advances in recent years, Hong Kong is by no means a parliamentary democracy. The new legislature must still deal with the colonial administration. The governor, who is appointed by the British prime minister, can veto any bill the LegCo passes with impunity; he can ignore any vote of no confidence. In this sense, all legislators are ''oppositionists'' to the real governing party, which is the governor and the civil service. Having led the charge for democracy, Gov. Chris Patten will likely use his power with discretion. The coming months may see battles over social legislation. Here the Democrats may make common cause with the small number of pro-Beijing legislators. For despite differences over how to approach China, the two groups see eye-to-eye on many purely local matters, such as importation of foreign labor.