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.




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


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.


171 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



Twitter and LinkedIn »



Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

OPPO Find X2 Lite brings flagship features to mid-range 5G smartphone
Posted 29-May-2020 12:52


Sony introduces the digital camera ZV-1 for content creators
Posted 27-May-2020 12:47


Samsung Announces 2020 QLED TV Range
Posted 20-May-2020 16:29


D-Link A/NZ launches AI-Powered body temperature measuring system
Posted 20-May-2020 16:22


NortonLifeLock Online Banking Protection now available for New Zealand banks
Posted 20-May-2020 16:14


SD Express delivers new gigabyte speeds for SD memory cards
Posted 20-May-2020 15:00


D-Link A/NZ launches Nuclias cloud managed network solution hosted in Australia
Posted 11-May-2020 17:53


Logitech introduces new video streaming solution for home studios
Posted 11-May-2020 17:48


Next generation Volvo cars to be powered by Luminar LiDAR technology
Posted 7-May-2020 13:56


D-Link A/NZ launches Wi-Fi Certified EasyMesh system
Posted 7-May-2020 13:51


Spark teams up with Microsoft to bring Xbox All Access to New Zealand
Posted 7-May-2020 13:01


Microsoft plans to establish its first datacenter region in New Zealand
Posted 6-May-2020 11:35


Genesis School-gen has joined forces with Mind Lab Kids
Posted 1-May-2020 12:53


Malwarebytes expands into privacy with fast, frictionless VPN
Posted 30-Apr-2020 16:06


Kordia to donate TV airtime on Channel 200 to community groups
Posted 30-Apr-2020 16:00



Geekzone Live »

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


Support Geekzone »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron



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.

Alternatively, you can receive a daily email with Geekzone updates.