xml doctype??

  • Gasolene
  • Beginner
  • Beginner
  • Gasolene
  • Posts: 39

Post 3+ Months Ago

I am changing my site from html 4.01 strict to xml

however now, MSIE displays my pages in html 4.01 transitional and NS in strict.

(they both do margins differently)

how do I get my xml doc to display strict html.
I use an xsl stylesheet to transform my xml docs into html.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Mas Sehguh
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1853

Post 3+ Months Ago

My crystal ball is in the shop. Could you show a URL? I am guessing you have one of those <?... things at the top, which throws IE into retard-mode.

I am curious: what do you find wrong with HTML 4?
  • Gasolene
  • Beginner
  • Beginner
  • Gasolene
  • Posts: 39

Post 3+ Months Ago

heres an example xml file...

Code: [ Select ]
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="style.xsl"?>

<doc type="index">
 <title>My Title</title>
 <body>bla bla bla</body>
</doc>
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet type="text/xsl" href="style.xsl"?>
  3. <doc type="index">
  4.  <title>My Title</title>
  5.  <body>bla bla bla</body>
  6. </doc>


heres an example xsl file...

Code: [ Select ]
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/doc">

<html>
<head>
<title>
 <xsl:value-of select="title"/>
</title>
</head>
<body>
<xsl:value-of select="body"/>
 <div style="width: 100px; background-color: #f00; padding: 50px;">
 bla bla
 </div>
</body>
</html>

</xsl:template>
</xsl:stylesheet>
  1. <xsl:stylesheet version="1.0"
  2. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:template match="/doc">
  4. <html>
  5. <head>
  6. <title>
  7.  <xsl:value-of select="title"/>
  8. </title>
  9. </head>
  10. <body>
  11. <xsl:value-of select="body"/>
  12.  <div style="width: 100px; background-color: #f00; padding: 50px;">
  13.  bla bla
  14.  </div>
  15. </body>
  16. </html>
  17. </xsl:template>
  18. </xsl:stylesheet>


note the div element...

the problem is that when viewed in netscape the div element is 200px wide, in MSIE it is 100px wide.

that is because netscape is using strict and msie is using transitional.
If it were an html doc i would set the doctype to strict and problem solved. but i don't know how to set the xml doc type to strict.

hopefully that makes more since.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 84 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.