A dog can hyperventilate and/or urinate when they become very excited, seemingly unable to control their emotions which can lead to a temporary loss of bladder control. Some dogs, the Yorkshire Terrier is undoubtedly one of the breeds, becomes overexcited very readily. You can help your Yorkie when your dog hyperventilates by partially covering his mouth, so that they breathes back in a bit of carbon dioxide, just as humans do when breathing into a paper bag.
You can determine the trigger. Does your Yorkie urinate when you come home ? Do they get over excited when you are getting ready to go for a car ride?
Once knowing what the trigger is, you can then begin to train your Yorkie to become used to those situations, at a measured and steady pace, so that your dog becomes so accustomed to the source, that it no longer causes them to lose control.
For example, if your dog gets very excited when you come home from work, you can incorporate some training by coming in and out of the door. Every time you come in, do not greet your dog. (Yes, it is tempting, but do not do it). Just check you messages, pick up the clutter in the living room or do some activity that is quiet and takes 1 to 2 minutes.
Then, kneel down and in a very calm and soothing voice, greet him or her.