dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: XSLT prob with Doctype

  1. #1
    Join Date
    May 2009
    Posts
    3

    XSLT prob with Doctype

    0

    I am transforming XHTML to XHTML using XSLT and Doctype part is giving me problem

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <?xml-stylesheet type="text/xsl" href="LimeSurvey.xslt"?>
    <!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" xml:lang="en" lang="en">
    ...
    <html>


    and this is not valid xml, according to IE8, FF3. Is there any way to prevent generating DOCType, xmlns from php engine? Or is there any way to make XSLT ignore DOCTYPE and xmlns?

    Thanks, Ebe

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    It's likely that the DOCTYPE is fine but your XML is invalid. Run it through The Validator.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    May 2009
    Posts
    3
    XML document is fine, but it is not XHTML compliant(paragraph is embedded in font tag etc...), therefore with presense of DocType, the the validation fails and XSLT doesn't run properly. Therefore if i remove DocType, the XSLT transformation succeeds. Therefore, i need either php engine not to generate the doctype declaration or XSLT to ignore it.

    Thanks,
    Ebe.

  4. #4
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    Or you need to be generating a valid document.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  5. #5
    Join Date
    May 2009
    Posts
    3
    The document is generated by php code, which is a kind of big,legacy system, and i don't have much control over it.

    thanks,
    Ebe

  6. #6
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    I feel your pain but you're just going to have to go in there and fix the PHP. One of the fundamental principals of XML is that all things are supposed to stop when something is invalid or not well formed.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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