Subject:Rendering HTML inside XML through XSL - HELP !!! Author:Steve Nicolson Date:23 May 2007 01:15 AM Originally Posted: 23 May 2007 01:10 AM
Hello everyone ! This is my first post and its very urgent for me :) hope you guys will help me out here.
I have this xml in which I have html tags. I want to render the "<myhtml>" (as in example below) tag through my XSL while retaining its formatting. At the moment my xsl (<xsl:value-of select="/top/myhtml"/>) is rendering <myhtml> tag's inner content as it is without taking care of any formatting tags
e.g.
<top>
<myhtml>
Some <b>bold</b> content and some <i>italic</i> content
</myhtml>
</top>
Using <xsl:copy-of> in place of <xsl:value-of> as per suggestion generated the following error
Keyword xsl:copy-of may not be used in namespace http://www.w3.org/TR/WD-xsl. I had been using this namespace specifically to get the sort operation work ("order-by='id'").
xsl:value-of doenst give you back the attributes and childs so you have to use xsl:copy and use it recursive to be sure you get the childs of the childs and so on.
Subject:Rendering HTML inside XML through XSL - HELP !!! Author:Steve Nicolson Date:23 May 2007 09:42 AM Originally Posted: 23 May 2007 09:41 AM
@Elias..
>Ok I'm not 100 % sure what you
>want, . . .
Now you are.. and this is 100 % what I was trying to do! Thanks - you have been great help!
Err.. since i am new into this xslt thingy, 1 thing I'd like to ask you in the context of my Q (without hijacking my post ;)).. So far i havent been using any xml tool for the task, what tool you think (without being biased :D) would suit me for this kind of development since I'd now be into a lot of 'node processing' (searching by date/time, e.g.) after getting through this rather basic thing.
Subject:Rendering HTML inside XML through XSL - HELP !!! Author:Elias Huter Date:23 May 2007 10:40 AM Originally Posted: 23 May 2007 10:39 AM
I'm not really into this topic but I can tell you what where the two things why we deceided for Stylus Studio:
- A really big company suggested it to us as XSLT/XML tool which fits best for our needs (Mainly Mappings from one format to another e.g. IDOC to EDIFACT) and they also used it by themselves
- The biggest advantage was that you can change the parser, to whatever you want. As we use SAP-XI we can use the XI Parser which is very important, as for example Saxon would accept "something" but the XI-Parser rejects the same thing (and the other way round). That would result in an "OK" in your development tool (with lets say Saxon parser) but an error after deploying it (SAP-XI parser)
So far I can say that for those things we are doing with it, Stylus Studio is a very good tool with fast developer feedback as a plus.
I suggest you download a few tools, they all offer trial versions, and find the tool which fits for you best! The only other tool I know is XML Spy which also seems to be pretty popular.
Subject:Rendering HTML inside XML through XSL - HELP !!! Author:Elias Huter Date:23 May 2007 11:24 AM Originally Posted: 23 May 2007 11:18 AM
Be sure you use the technique in my last post -> myhtml_new(1).xsl otherwise you will get a <comment> tag within your <td> tag because the comment tag is also copied.
Update:
Very unlucky -> it seems as if Internet Explorer interprets <comment> tags and just skips everything inside. Would the tagname have been for example <freetext> you would have gotten an output anyway.