I have this as my .xsl: <?xml version="1.0" encoding="utf-8"?><!DOCTYPE xsl:stylesheet> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:output method="html" encoding="utf-8"/>
Msg#: 3693731 posted 2:40 am on Jul 10, 2008 (gmt 0)
is the output XML, or HTML?
in HTML, an <i> means italic. in XML, an <i> just means "i".
So if your browser thinks it's still XML, you won't see italics. 3 things come to mind which might get your browser to misinterpret: check the file extension, the mimetype, and the DOCTYPE declaration.
My DOC declaration on the php file is: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
In the XML, you need to designate the description as CDATA - this means it's treated as a whole like Character Data, and elements within it are not interpreted as additional nodes in the XML.
Change the XML slightly, so it looks like this:
<?xml version="1.0" encoding="utf-8"?> <bios> <bio> <name>My Name</name> <title>My Title</title> <image>image.jpg</image> <description> [red]<![CDATA[[/red]tex text <i>This should be italic </i> text text[red]]]>[/red] </description> </bio> </bios>
Then, you need to add to the XSLT, so it doesn't turn those angle-brackets into < and >. To do that, you add the "disable-output-escaping" attribute to that element. This is important when outputting text formatted with HTML. The XSLT looks like this: