Jump to content

Need help with XML


Shadow Wolf

Recommended Posts

I am learning to work with XML and have been working to apply a couple tutorials with the xml file that I am attempting to work with.

 

The xml I am working with:

http://www.animeregister.com/roster.xml

 

I've figured out how to pull the data out that I want and modify the format with a XSL that I have here:

http://www.animeregister.com/roster.xsl

 

Now I'm trying to figure out a way to sort through the data, so a user can choose to sort it. I make manual sort by using:

<xsl:sort select="@name/>

 

I can change it to ascending, descending and choose level instead of name if I wanted. But I have to make those changes.

 

Is there a way to add multiple sort options? So if they click on Name, it would then ascending sort by name. Clicking on name again, it is now sorted descending by name. If they click on rating it would sort descending by rating, if they click on that again then it would sort ascending and so forth?

 

From looking at some tutorials it looks like I can use a "xsl:when" and "xsl:otherwise" command to display or create my two different order options descending and ascending. But I still can't figure out how to I translate that into a clickable link on X item to change the sort.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.