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.


138 posts

Master Geek
+1 received by user: 17


  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 »

CPTPP text and National Interest Analysis released for public scrutiny
Posted 21-Feb-2018 19:43


Foodstuffs to trial digitised shopping trolleys
Posted 21-Feb-2018 18:27


2018: The year of zero-login, smart cars & the biometrics of things
Posted 21-Feb-2018 18:25


Intel reimagines data centre storage with new 3D NAND SSDs
Posted 16-Feb-2018 15:21


Ground-breaking business programme begins in Hamilton
Posted 16-Feb-2018 10:18


Government to continue search for first Chief Technology Officer
Posted 12-Feb-2018 20:30


Time to take Appleā€™s iPad Pro seriously
Posted 12-Feb-2018 16:54


New Fujifilm X-A5 brings selfie features to mirrorless camera
Posted 9-Feb-2018 09:12


D-Link ANZ expands connected smart home with new HD Wi-Fi cameras
Posted 9-Feb-2018 09:01


Dragon Professional for Mac V6: Near perfect dictation
Posted 9-Feb-2018 08:26


OPPO announces R11s with claims to be the picture perfect smartphone
Posted 2-Feb-2018 13:28


Vocus Communications wins a place on the TaaS panel
Posted 26-Jan-2018 15:16


SwipedOn raises $1 million capital
Posted 26-Jan-2018 15:15


Slingshot offers unlimited gigabit fibre for under a ton
Posted 25-Jan-2018 13:51


Spark doubles down on wireless broadband
Posted 24-Jan-2018 15:44



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.