Jump to content
Belegkarnil

Use Javascript on HTML generated by XSLT (browser)

Recommended Posts

Hi !I customize a Web Framework to use XSL stylesheet on XML and generate HTML 5.I want to report the process (XSL transformation) on the client-side if the client support XSLT.But if the client do not support this operation, I want to process on the server-side and send the generated HTML 5.My problem is : the Javascript function I call on the page works on XML content (ot HTML 5 if the browser does not support XSLT).But I would like to use Javascript on HTML 5 for both cases.So how can I access to the rendered content ? Not on the source content ?Thanks

  • Like 2

Share this post


Link to post
Share on other sites

If you're going to write the code to generate the HTML5 content anyway, why do the additional work of sending XML if the client supports it? Why not always generate and send the HTML5, and have a single set of Javascript?

Share this post


Link to post
Share on other sites

So you're targeting browsers that don't support Javascript but do support XML/XSLT transformations? I'm confused though, your question was about how to get Javascript to run on the transformed content, correct?

Share this post


Link to post
Share on other sites

I want to support all cases :1 : with JS, with XSLT2 : with JS, without XSLT3 :without JS, with XSLT4 :without JS, without XSLTand yes, I want to run JS on transformed content to create only one JS code for cases 1 and 2.

Share this post


Link to post
Share on other sites

Unfortunately I don't think I can answer your question, I tend to stay away from XML when I can. Others may be able to provide help.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...