You actually can pass thru China TWICE, such as - JFK-PEK-HKG, on one ticket. Then HKG-PVG-SFO on another ticket. You can spend 10 days in PEK and later another 10 days in Shanghai.
Or many use TYO and TPE. The actual itineraries mentioned in another thread below iirc, were doing exactly that.
I also read on another Chinese forum, it was soooo difficult to get the Travel Visa for the kid, the family ended up cancel the original ticket to buy a r/t ticket US-PVG-US, then a r/t ticket PVG-HKG-PVG - A Nestling Ticket set. They were able to get on plane in US and explained their situation at PVG, showing their PVG-HKG r/t. No problem. They were allowed to enter. Then after 10 days they went to HKG, then use the return portion to fly HKG-PVG, another 10 days, PVG-US on the first ticket.
This is really a stupid policy when China could just give 30 days Visa Free for US passports, and a few others.