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 »

UAV Traffic Management Trial launching today in New Zealand
Posted 12-Dec-2017 16:06


UFB connections pass 460,000
Posted 11-Dec-2017 11:26


The Warehouse Group to adopt IBM Cloud to support digital transformation
Posted 11-Dec-2017 11:22


Dimension Data peeks into digital business 2018
Posted 11-Dec-2017 10:55


2018 Cyber Security Predictions
Posted 7-Dec-2017 14:55


Global Govtech Accelerator to drive public sector innovation in Wellington
Posted 7-Dec-2017 11:21


Stuff Pix media strategy a new direction
Posted 7-Dec-2017 09:37


Digital transformation is dead
Posted 7-Dec-2017 09:31


Fake news and cyber security
Posted 7-Dec-2017 09:27


Dimension Data New Zealand strengthens cybersecurity practice
Posted 5-Dec-2017 20:27


Epson NZ launches new Expression Premium Photo range
Posted 5-Dec-2017 20:26


Eventbrite and Twickets launch integration partnership in Australia and New Zealand
Posted 5-Dec-2017 20:23


New Fujifilm macro lens lands in New Zealand
Posted 5-Dec-2017 20:16


Cyber security not being taken seriously enough
Posted 5-Dec-2017 20:13


Sony commences Android 8.0 Oreo rollout in New Zealand
Posted 5-Dec-2017 20:08



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.