0

<team>
  <teamleader info="Team Leader">
    <name>Suresh KC</name>
    <email>[email protected]</email>
  </teamleader>
  <member id="ME1A">
    <name>Harry Jones</name>
    <email>[email protected]</email>
    <salary>2500</salary>
  </member>
  <member id="ME3A">
    <name>John Deo</name>
    <phone>9866123456</phone>
    <salary>2500</salary>
  </member>
</team>

i want to display teamleader and member as

  1. Suresh KC [email protected]
  2. Harry Jones [email protected] 2500
  3. John Deo98661234562500

I tried using list-style-type:decimal; property of css but it doesnot work.

3
  • if you are getting this xml from some service, use JS and parse the xml to some object and then insert into the html... Commented Apr 24, 2019 at 13:14
  • @Kushal I'd recommend you use an ordered list if you want numbers - <ol></ol> (not ul) Commented Apr 24, 2019 at 13:29
  • Possible duplicate of Display XML content in HTML page Commented Apr 24, 2019 at 13:30

1 Answer 1

2

You could do this using only CSS, see my example below. It is more common to parse the XML using javascript and than displaying it as a list element. You'll be way more flexible that way.

teamleader,
member{
  display: list-item;
  margin-left: 1.3em;
  list-style-type: decimal;   
}
<team>
  <teamleader info="Team Leader">
    <name>Suresh KC</name>
    <email>[email protected]</email>
  </teamleader>
  <member id="ME1A">
    <name>Harry Jones</name>
    <email>[email protected]</email>
    <salary>2500</salary>
  </member>
  <member id="ME3A">
    <name>John Deo</name>
    <phone>9866123456</phone>
    <salary>2500</salary>
  </member>
</team>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.