Give a Spring WS dynamic-wsdl some style (using XSLT ?) - xslt

I'm currently trying to give my WSDLs some design by attaching a stylesheet to it, so that it could be readable by a technical but non-dev human being.
I was thinking I could add some XSLT to my generated spring-ws dynamic-wsdl so that it could be sent to the browser as a pure html (and not xml as it is). But I couldn't find any way to add xslt to the generated wsdl
Can you see any way to accomplish that ?

Related

Saxonica EE as XSLT transformer

We are planning to use Saxonica EE (yet to buy) in Spring Boot microservice on Cloud Foundry and we want to store the XSLT compiled version in XML in Redis cache so that when do transformation it would be less time consuming, I have below questions, can you please guide me in right direction.
how can we deploy Saxon EE libs with licence to the cloud, any standard practice need to be followed.
is it possible to get the XSLT compiled code in XML format so that I can store in Redis cache, is this approach make sense (if there is any change in XSLT I will re-compile every time)
Any java programming samples, we use xsl:include heavily in all xsls , if there is any example for the same use-case would be great.
For the commercial questions regarding licensing for cloud deployment, that's out of scope for StackOverflow - please contact Saxonica directly to discuss this.
Saxon-EE can compile a stylesheet to a SEF file which is indeed an XML format, but I've no idea whether storing the compiled stylesheets in Redis makes any sense.
If you have a problem using xsl:include, I suggest you raise it as a separate question. A general request for advice on using a particular feature isn't likely to elicit helpful responses - StackOverflow works best if you have a specific technical question, or a specific technical problem. (If you want general advice, my XSLT reference book has about 4 pages on xsl:include, with examples).
I recommend you to start by getting the basic foundation of clarity in place as described below:
About choosing Redis for storage :
If your going for Redis as storage you normally would have to serialize your (XSLT processed) output into XML or JSON prior to storing it into Redis. This means also that any time you want to access the data in a more human-friendly readable way, you would have to deserialize the Redis string.
Answers on your bulleted questions (in relation to XSLT) :
[1] Cloud deployment: Even if you would like to use cloud solutions you would still need to define on which server you would like to install Java/SDK and Saxon libraries (jar). In terms of details around license for cloud solution, I would refer to the company Saxonica.
[2] Need of compiling: Saxon XSLT is not normally being compiled by user (unless there is a reason for it). I suspect when you say "compiled" in this bullet that you mean the transformation process, using a source XML, XSLT for processing and getting an output XML. - If so, you can set which output format you want (XML/HTML/XHTML). Every time you change something in your source- or XSL file, you would need to run XSLT to see the change in the XML output file.
[3] Need of Java samples: You do not need Java knowledge to build XSL stylesheet files. The Java comes into the picture if you choose to run on Java you would need to setup Java/SDK on the machine that would run Saxon XSLT. After the setup (Java/SDK and XSLT) you can choose between calling XSLT from a terminal or create scripts that would call XSLT (I use bash scripts in Linux).
I recommend that you start using an online XSLT tool meanwhile you solve your Java environment and Saxon XSLT. This way you can build up your XSL files or test any of your existing XSL files in order to adjust them to your needs.

Can Adobe Experience Manager make xsl files?

Can Adobe Experience Manager be used to make xsl files that convert xml into html?
If yes, please explain how to do it.
The short answer is yes Adobe Experience Manager (AEM) can be used to generate XSL and then use it to convert XML into HTML. Depending on what you are trying to accomplish, that may not be the best way to go about it.
From the question it's not clear but it sounds like you want to make an XSL with AEM. Typically a developer would create the XSL one time and then apply it to the XML to get your HTML. You can provide pretty elaborate XSL which should work for all cases. If did want to generate an XSL you would need to write custom code to accomplish this. The best way is to probably create a workflow task to create the XSL file in your AEM repository for later use.
The next step is to decide when you want to generate your HTML. Is it at request time which can be expensive or when you do a create or update on the XML? If it's when the request is made you would need to create a servlet using an XSLT library. Here's more information on how to do that from another thread XSLT processing with Java?. If you want to generate the HTML rendition whenever the XML is created or updated you'll need to create a workflow task and register it to launch each time a create or update happens on that file type. You'll also need to create a servlet to render the html you've generated.
You've asked a complex question without giving much information so I'm not sure either solution is the best scenario for goal. It might be easier to convert your xml into an AEM package and create nodes in the repository. Then you can render the HTML using Sightly

Sitemesh or XSLT for layout

I am designing a layout for my crm project now.
Now i am ended with 2 options one is sitemesh to define the layout or XSLT to define a layout.
Sitemesh will run at runtime from the server , it wont cause any issue if the number of request is high?
I guess XSLT will run at the browser based on the Xpath , is this correct?
Which one is better to use?
Please help me
Thanks
You can run XSLT either in the browser or at the server. The advantage to running it at the server is that the HTML you generate will be the same regardless of what browser the user has. If you run it in the web browser, users with different browsers might get slightly different results, because different XSLT transformation engines have different quirks, kind of like different web browsers do when rendering the same HTML and CSS.
I've designed and taught a corporate 1-day intro to XSLT class. I love the way XSLT works. That said, it has been criticized for running slowly and being hard to learn.
I've just started using SiteMesh 2.0, and I really like it. If you are not familiar with XSLT coding, you may be more comfortable with SiteMesh, because it simply wraps your content with a header/footer you create. You don't have to write and debug XSLT code.

Webservice to apply XSLT to response before sending?

I have a basic asp.net webservice that returns a simple response.
To make it ucore compliant I need to apply an XSLT.
Is there a way to apply an XSLT to my response?
I'm aware the receiver can apply it on their end, but in this scenario I need to apply it on my end.
Thanks!
See Custom Message Formatters.
Ignore ASMX web services. They have very little extensibility and are now considered to be "legacy technology" by Microsoft.
Whether you're talking about legacy ASMX or the current WCF web services, you're talking about controlling the serialized XML on output. Both the ASMX and WCF handlers by default will fire the serialization routines for the underlying objects used in their respective web service methods.
You could do it if you want to work outside the construct of serialized XML. Your method could return a string which is nothing more than the output of your method. You would need to:
Go through the logic of building your resultant object
Serialize the object to XML -- as a string
Run an XSL transformation on the XML to an output stream
Return the output stream's contents from your method
This is an extremely lousy hack, though.
EDIT: per John's reference, focus on solving this through control of the output XML. If you're using legacy ASMX, this is basic XML serialization. If you're using WCF, there are greater formatting options available.

Need an alternative to BizTalk's XSLT generation

At present we are using BizTalk as an XSLT generator. We map two XSDs together and then have BizTalk generate and XSLT that we use in another app. Shortly we will be getting rid of BizTalk and are on the hunt for a new program that will provide us this functionality.
Thanks!
Sad to hear you are loosing BizTalk.
I have tried MapForce from Altova, more info here, it has similar functionality as BizTalk mapper.
I completely agree with Martin.
It's good that you are moving out of BizTalk if you are only using it as an XSLT generator.Using BizTalk just as an XSLT generator is like using YAG laser to cut through butter.(http://www.youtube.com/watch?v=aRZ8TlvH2gc)