0 votes
in XML by
Write a code for XML attribute and element.

1 Answer

0 votes
by
1) Below is the code using the XML Attribute and elements

<Person location = “India”>

<Statename>Maharashtra</Statename>

<Cityname>Mumbai</Cityname>

</Person>

     <Person>

     <Location> India </Location>

     <Statename>Maharashtra</Statename>

     <Cityname>Mumbai</Cityname>

     </Person>

In the first element, location is an attribute. In last, location is an element. The user can choose the attribute or element.

Related questions

0 votes
asked Aug 13, 2020 in XML by SakshiSharma
+1 vote
asked Aug 20, 2020 in XML by Robindeniel
...