Connecting Tech Pros Worldwide Forums | Help | Site Map

Use xhtml inside XML based on XSL

Newbie
 
Join Date: Dec 2006
Posts: 9
#1: Jan 3 '07
I have a XSL-file who generate output to a browser through information in a XML-file. It works fine, but now I also want to use some xhtml-tags in this XML-file. I've tried to do it like this when i want to use xhtml-tags:
Expand|Select|Wrap|Line Numbers
  1. <strong xmlns="http://www.w3.org/1999/xhtml">strong text</strong>.
  2.  
But it does not seem to work. The browser shows the text, but not as «strong». Do I need to include a DTD-file or something? Anyone knows?

Newbie
 
Join Date: Jan 2007
Posts: 4
#2: Jan 4 '07

re: Use xhtml inside XML based on XSL


Hi,

If you have used the <xsl:value-of > element , in your XSL file,then this will just write
the string representation of the value assigned to a specified node.

For ex.
If the xml is:
<url_text><strong>Strong text</strong></url_text>

Then the XSL rule
<xsl:value-of select="url_text" />
will write the string 'Strong text' in the result tree.

So if this is the case,then just try to use <xsl:copy-of> element.

For ex.
<xsl:copy-of select="url_text/*" />
will write the following string

<strong>Strong text</strong>.
Newbie
 
Join Date: Dec 2006
Posts: 9
#3: Jan 4 '07

re: Use xhtml inside XML based on XSL


Thanks, thats it. :)
Reply