www.webdeveloper.com
Results 1 to 4 of 4

Thread: FF XSL transform returning unexpected result

  1. #1
    Join Date
    Apr 2010
    Posts
    2

    FF XSL transform returning unexpected result

    Hi,

    I'm currently using the code below to style some XML
    Code:
    var processor = new XSLTProcessor();
    processor.importStylesheet(xslDoc);
    var xmlDom = processor.transformToDocument(xmlDoc);
    		
    var serializer = new XMLSerializer();
    output = serializer.serializeToString(xmlDom);
    and my stylesheets output method is set to HTML, and it's styling in IE fine, but in Firefox I'm getting the following back:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3c.org/tr/html4/strict.dtd">
    
    <transformiix:result xmlns:transformiix="http://www.mozilla.org/TransforMiix">Upcoming Events Thursday, 22 April randal's birthday Please bring cake Thursday, 13 May Ascension  Sunday, 15 August Assumption Day Some description</transformiix:result>
    it's not formatted as html at all. Please, any help would be greatly appreciated.

    Thank you so much.

  2. #2
    Join Date
    Jan 2003
    Location
    Texas
    Posts
    10,413
    Hi,

    Can you post an example of what you're working with in a .zip file, please? I'd like to take a look at it, but I don't have the XML or XSL files to do any testing.
    Visit Slightly Remarkable to see my portfolio, resumé, and consulting rates.

  3. #3
    Join Date
    Jul 2008
    Location
    urbana, il
    Posts
    2,787
    try:
    Code:
    output=xmlDom.documentElement.innerHTML;

  4. #4
    Join Date
    Apr 2010
    Posts
    2
    Thanks for the response - much appreciated.

    I found by changing my output method from
    Code:
    <xsl:output method="html" />
    to
    Code:
    <xsl:output method="html" indent="yes"
                encoding="iso-8859-1"
                media-type="text/html" doctype-public="-//W3C//DTD HTML 4.0//EN"/>
    solved the problem.

    Thanks anyways.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles