Search

Hi,

is there a way to transform xml returned from an ajax call to a symphony page with xslt on the current page? if i understand correctly probably not as the xslt process has already done its work. am i right?

what i want to accomplish is to have a filtermenu on each page which gets its (variable) menu-options from an xml page via the jQuery Forms Plugin (http://malsup.com/jquery/form/).

so that one can change a selectbox in the menu and the other selectboxes adjust according to the generated xml from the request.

has anyone done a something like that and can maybe push me in the right direction?

cheers
daniel

I've done some stuff a bit like this before, but I've used mixed approaches. In some cases I'll write jquery/javascript to process the data and then replace the options in the select tag, or if you want to do it server-side then the page being requested can render the new HTML for the form rather than XML and replace the selects that way. I'm not sure if either of these would suit what you're doing without more context though.

You could create a Remote Datasource which relies on parameters to call the XML API, attach that to a page in Symphony with some page parameters (the ones used in the API datasource), then you can call that page using Ajax, passing in Select box values as the parameters.

You can then use XSL for the page to output new Select box values.

i am trying my luck with generating html in the response and replacing the whole menu with it as Sam proposed above right now. thanks for the tip ;)

@john: sounds very promising but unfortunately also a bit over my head. i don't really get what you are proposing. maybe i just need to let it go for today ;) been a long day.

The only disadvantage of doing it that way is you lose the flexibility of having a pure xml response, but if the page/data you're requesting only serves one purpose it makes sense to have it create your html for you.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details