O'Reilly logo

Sams Teach Yourself XML in 10 Minutes by Andrew H. Watt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating New Elements

In this section, you will look at two reasons why you might need to create new elements.

In some transformations, the element names in the source document and the corresponding element name in the output document differ. For example, suppose that a company based in the United States is doing business with a company based in the United Kingdom. The U.S. company wants to place an order for white shirts. In the United States, the company might describe a white shirt, using this:

<Color>white</Color> 

The U.K. company might use this line, however:

<Colour>white</Colour> 

Only one letter is different in the element type name, but that is enough to trip up an XML parser.

Consider also that you might want to create a new element ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required