XML-Transformation/Creation
This is an open discussion with 3 replies, filed under General.
Search
maybe that way ? my eventname is msg, so change this...
<xsl:choose> <xsl:when test="not(events/msg) or events/msg[@result != 'success']" > <!-- do something --> <xsl:for-each select="/data/events/msg/*"> <xsl:choose> <xsl:when test="[@type = 'missing' or @type = 'invalid' ]" > <!-- do something --> </xsl:when> </xsl:choose> </xsl:for-each> </xsl:when> </xsl:choose>
don't know wheter wildcard is ok in foreach loop, is test in difference templates.
like this gist: https://gist.github.com/strlcp/6602414
Maybe this combined with @moma's comment gives you a direction:
http://xpathr.com/view/6605825/067576942bcb2a4cd987fa3d636258c48f1f762a/
Thank you for the help,
I managed to fix my problem with your advice :) Solution: Instead of writing it how I am used to do it, I transformed my way of thinking so that XSL accepts it ;)
Create an account or sign in to comment.
Hi people,
I've set up Symphony with some extensions and started to build a test-drive site. I have to admit, I started XSL when I installed Symphony like 3 weeks ago...
So, I wrote a little template to display common Messages. This is the XML-Input it should accept:
(I may extend it later, or change it...)
From a common POST-(Error-) Event I get this XML result:
How do I transform Symphony's result into my desired format?
As well: Since I want to use my template to display custom-messages (not coming from POST-Results etc), how do I create the XML-Data to feed my template? I tried things like xsl:element, but it always prints the content to screen only :D
As I said, I'm quite new to XSL...
Greetings