Can the general leave the palace in xiangqi?
These answers restate the rules implemented by our open-source engine, which follows the WXF laws and is regression-tested against the official 110-diagram repetition casebook. Where an answer refers to a specific position, that position lives on the linked reference page, where the build verifies it against the engine before publishing.
Direct answer
No, never. The general moves one point at a time, orthogonally, and may only ever stand on the nine points of its own palace. Both advisors are confined the same way. This holds from the first move to the last — there is no situation, including escaping check, that permits leaving.
What this means in play
The target never moves. In chess you have to work out where the king will end up; here you know from move one, which makes attacking a counting exercise rather than a guess.
It also means the general can be smothered by its own defenders. Advisors sitting on the wrong points remove the general's escape squares, and several standard mates depend on exactly that.
The one way the general reaches out
It cannot leave, but it is not passive. Under the flying general rule the two generals may never face each other on a clear file, so your general controls the whole file it stands on from the enemy general's point of view.
In a bare endgame that is a free extra attacker, and several basic mates do not work without it.
Related questions
Can the general move diagonally?
No. The diagonals drawn in the palace show the advisor's moves. The general uses only the straight lines.
Can the general capture?
Yes, any enemy piece standing on an adjacent point inside the palace, provided the capture does not leave it in check.