Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


aboylikedave

243 posts

Master Geek


#148851 2-Jul-2014 22:29
Send private message

OK, thanks to advice on this thread, despite having no programming experience I have successfully managed to use XSLT to take XML data and display it as an HTML table.

As an example let's say I am using the following XML containg data on CDs. It's not my real data but gives an example.

What I want is for someone to be able to select a value for <artist> via a drop down on the webpage and then filter the XML which is displayed, based on that input. So if they selected 'The Clash' it would only show details for 'London Calling'.

How best can I achieve this? Can I use javasript to receive the input and then reload the page using the input to determine which XSL file is selected? Or can I use javascript to dynamically update the xsl file.

I guess I am after the simplest way to execute this given a) my massive lack of programming skills (I'm pretty much learning from scratch but enjoying it massively) and b) speed and elegance is not a pressing need - it's the function I need.

The other thing is that my number of values for <artist> will be fixed at 20.

<cd>
<artist>
Bowie
</artist>
<title>
Ziggy Stardust
</title>
</cd><cd>
<artist>
Bowie
</artist>
<title>
Heroes
</title>
</cd><cd>
<artist>
The Clash
</artist>
<title>
London Calling
</title>
</cd>

Cheers




My EPL football websites: Get the results but hide the score of your team at HidetheScore.net. Compare league positions with wage bills at RealPremierLeague.net.


Create new topic
aboylikedave

243 posts

Master Geek


  #1081630 5-Jul-2014 21:35
Send private message

Apparently XSLT parameters is the answer...




My EPL football websites: Get the results but hide the score of your team at HidetheScore.net. Compare league positions with wage bills at RealPremierLeague.net.




LesF
176 posts

Master Geek


  #1090660 17-Jul-2014 13:23
Send private message

Personal preference would be to do most of the work in javascript and use the xslt just to format the data into something accessible by the javascript.  What is the source of your data?  Can you get it in JSON format instead of XML?
Really depends if you want to learn javascript and maybe some helper libraries, rather than learning xslt.

Create new topic





News and reviews »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15









Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.