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
+1 received by user: 4


Topic # 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
+1 received by user: 4


  Reply # 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.


160 posts

Master Geek
+1 received by user: 19


  Reply # 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 »

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 »

Cove sells NZ's first insurance policy via chatbot
Posted 25-Jun-2018 10:04


N4L helping TAKA Trust bridge the digital divide for Lower Hutt students
Posted 18-Jun-2018 13:08


Winners Announced for 2018 CIO Awards
Posted 18-Jun-2018 13:03


Logitech Rally sets new standard for USB-connected video conference cameras
Posted 18-Jun-2018 09:27


Russell Stanners steps down as Vodafone NZ CEO
Posted 12-Jun-2018 09:13


Intergen recognised as 2018 Microsoft Country Partner of the Year for New Zealand
Posted 12-Jun-2018 08:00


Finalists Announced For Microsoft NZ Partner Awards
Posted 6-Jun-2018 15:12


Vocus Group and Vodafone announce joint venture to accelerate fibre innovation
Posted 5-Jun-2018 10:52


Kogan.com to launch Kogan Mobile in New Zealand
Posted 4-Jun-2018 14:34


Enable doubles fibre broadband speeds for its most popular wholesale service in Christchurch
Posted 2-Jun-2018 20:07


All or Nothing: New Zealand All Blacks arrives on Amazon Prime Video
Posted 2-Jun-2018 16:21


Innovation Grant, High Tech Awards and new USA office for Kiwi tech company SwipedOn
Posted 1-Jun-2018 20:54


Commerce Commission warns Apple for misleading consumers about their rights
Posted 30-May-2018 13:15


IBM leads Call for Code to use cloud, data, AI, blockchain for natural disaster relief
Posted 25-May-2018 14:12


New FUJIFILM X-T100 aims to do better job than smartphones
Posted 24-May-2018 20:17



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.

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