Jump to content

display xml elements as an ordered list using CSS


Recommended Posts

Hello everyone,I am trying to solve this problem. I have a simple xml file

<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/css" href="style.css"?><library><shelf>  <book>Green book</book>  <book>Red book</book></shelf><shelf>  <book>Yellow book</book>  <book>Purple book</book>  <book>Orange book</book></shelf></library>

and the style.css file looks like

library book{display: list-item;list-style-type: decimal;margin-left: 20px;}

Now, this displays my xml file like this1. Green book2. Red book1. Yellow book2. Purple book3. Orangle but I would like to achieve this result instead1. Green book2. Red book3. Yellow book4. Purple book5. Oranglethat means.. no counter reset between shelf element. Can anybody show me a way to do this, if there is such? Thank you

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...