Expand\Collapse all nodes

Can anyone give me an example about how I can make an XML file (displayed in a browser) that has a Collapse\Expand all option ?
Maybe it needs some javascript .Thank you
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

data-novaAuthor Commented:
for example i have this file

<Customer no="100" name="John Smith" country="Italy">
      <Sale saleid="501" date="2006-03-02" amount="10.00"></Sale>
        <Sale saleid="675" date="2006-03-11" amount="42.00"></Sale>
     <Otherinfo CustomerCategory="AA" Zone="4"/>
<Customer no="200" name="Davy Jackson" country="France">
      <Sale saleid="324" date="2006-02-22" amount="12.00"></Sale>
        <Sale saleid="700" date="2006-03-11" amount="56.00"></Sale>
     <Otherinfo CustomerCategory="BB" Zone="3"/>

 how can i display it so that i only see like this with the nodes collapsed
- <Customerlist>
+ <Customer no="100" name="John Smith" country="Italy">
+ <Customer no="200" name="Davy Jackson" country="France">
Errr...  I don't think you can...

That's just how the browser displays it

You can't embed javascript in an XML file...


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
data-novaAuthor Commented:

 i could use XSL.i dont need to have just the XML file
 I have seen it work in some places
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

create a file, save it with .xml extension and open it with Internet Explorer
data-novaAuthor Commented:

 well that displays all the nodes open , i want all of them displayed collapsed
you will be provided with + and - sign to the left of the tags.
you can use them to expand or collapse the xml file.

you can use xml editors.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.