XML Entity

In this tutorial you will learn about the XML Entity and its application with practical example.

We are familiar to HTML Entities. HTML Entity is symbolic representation of the information.

Lest take look at some HTML Entity –

  • © = ©
  • &lt; = <
  • &amp; = &
  • &quot; = “

XML also supports the entity , An entity in XML is represented using an ampersand (&), followed by the name of the symbol, and ends with a semicolon.

Example:

Creating an XML Entity

We can create our own custom entity, by defining it in DTD. Once we defined it we can use it in our XML document.

Syntax:

Here is syntax to define entity in DTD

Using Your Custom Entity

Once we have created XML entity we can use it in following way, let take look in below example code

 

In this tutorial we have learn about the XML Entity and its application with practical example. I hope you will like this tutorial.