Is "use JavaScript to transfer xslt + xml => html in client-side" a good solution?
-
I have several (maybe 5) templates there, and some data. I want to fill the data in the templates. Template likes a table, maybe 5 rows, 5 cells in a row, with some data fixed, some data needs to fill in. If I use xslt to defines template, use xml to save data, use JavaScript to transfer it to html in client-side, Is there some problems? Is this a good solution?
-
Answer:
There are so many client side templating frameworks to choose from. Take a look at this: http://engineering.linkedin.com/... I would also ditch XML in favour of JSON. JSON tends to have better support in the javascript world, and is a lot more compact and readable.
Ryan Phung at Quora Visit the source
Other answers
I wouldn't say so; the XSL implementation in most browsers is sub-par and haven't been actively maintained or updated. If you really want to do XSL transforms you're better doing them on the server side, and using JSON and JavaScript if you need to update a static HTML page with new data client-side.
Phillip Oldham
Phillip is right; using XSLT on the client side is not a good idea. Instead of doing that run an XSLT script on the server to transform the XML into HTML, which you canĀ then download to the client.
George Gombay
It all depends on your requirements. They drive everything. Is there a requirement that it not be done on the server (perhaps some of your clients could be in areas of low bandwidth or you are concerned about traffic and want to take a load off the server). Anybody who advises you in any way without examining your requirements is selling you snake oil.
Brian Newman
Related Q & A:
- What is a good XML visualization tool?Best solution by Stack Overflow
- What is a good GPA to shoot for to be admitted to UCLA as a transfer student?Best solution by Yahoo! Answers
- What is a good over-the-counter solution to blackheads?Best solution by huffingtonpost.com
- What is a good printer that I can use for occasional use?Best solution by tomshardware.com
- What's a good XML editor?Best solution by eHow old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.