简体   繁体   中英

Using a webpage/web application to read and collect elements from XSL file

I have xsl page which include a number of templates cover all i need to create the webpages i want, i call the templates using nodes into another xsl file,

I need to call and collect the templates into a webpage instead of xsl using dropdown-lists.

How can i achieve that? It seems not easy so any thoughts could help! Thanks in advance!

I find it pretty tricky too and don't have a full answer for you. Display the templates should be the easy part. You could catch them via XQuery, javascript as xml element from an xml file (the XSL stylesheet). To call just some specific templates, I don't know... One way to achieve your goal, is maybe using webServices to call xslTransform. You could do that easily with eXist for example ( http://en.wikibooks.org/wiki/XQuery/XQuery_and_XSLT#Creating_an_XSLT_service ). Exist embedded Webservices provide such functions (ie. calling XSLT inside web context). You have similar functionnalies in javascript (I guess...). Maybe using XQuery (or anything else) to dynamically generate a simple template stylesheet (ie : extracting the template and create a XSLT file with only it inside) and execute it could be a solution. Another way, may be using the mode attributes of templates. You could set an execution mode for a XSLT when launching it. But you may find yourself with one specific mode for each template...

Hope this could help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM