China and the EU have agreed to restrict exports of Chinese textiles to countries of the EU until 2007, resolving an ongoing trade dispute.