Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 26th, 2007, 11:27 AM
Registered User
 
Join Date: Sep 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default XML with CSS: IE vs Firefox

I am having difficulty styling a test page using an external stylesheet. The XML text begins ...
Quote:
quote:<?xml version="1.0" encoding="UTF-8"?>

<?xml-stylesheet href="Hamlet_4_1_w6_jmf.css" type="text/css"?>

<!--
    Modified with the jmfns namespace.
-->

<!DOCTYPE jmfns:Play SYSTEM "Hamlet_4_1_w6_jmf.dtd" [

    <!ENTITY KC "KING CLAUDIUS">
    <!ENTITY QG "QUEEN GERTRUDE">
    <!ENTITY RC "ROSENCRANTZ">
    <!ENTITY GS "GUILDENSTERN">
    <!ENTITY RC-GS "ROSENCRANTZ and GUILDENSTERN">
]>

<jmfns:Play xmlns:jmfns="IWA0274301.Beginning_XML.jmfns" xmlns:html="http://www.w3.org/1999/xhtml">
while the first few lines of the external stylesheet read ...
Quote:
quote:
jmfns\:Play {
     margin: auto;
    font-family: "Arial", "Helvetica", "Verdana", sans-serif;
    color: #000000;
    background-color: #98fb98;
    border-style:double;
    border-width: medium;
    width: 440px;
    padding: 12px;
}

jmfns\:Title {
    display: block;
    font-size: 16px;
    font-weight: bold;
    padding-top: 4px;
    padding-bottom: 12px;
    text-align: center;
}
Note that the colons [':'] in the external stylesheet are escaped per Microsoft.

The page displays as expected using IE, but none of the styling is displayed when using Firefox. Can someone suggest what I'm doing wrong? Thanks.



 
Old October 29th, 2007, 07:21 AM
Registered User
 
Join Date: Sep 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Again, could someone please suggest how I might use CSS & DTD together such that it will properly display (style) in both IE and Firefox/Netscape? Thank you.

 
Old October 29th, 2007, 07:28 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

There's not much point repeating the question. If no one has answered, it means that no-one who is listening knows the answer.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old October 29th, 2007, 07:34 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

I think that formatting XML directly in a browser via CSS is deceidely difficult to debug as you can't see what's actually happening. I think it's easier to use an XSL transform to generate traditional HTML/XHTML.

--

Joe (Microsoft MVP - XML)
 
Old October 29th, 2007, 07:37 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Firefox appears to match the local-name, without the prefix.

Have you tried just defining the CSS as

Play { }

or double defining them as

jmfns\:Play, Play {
}

/- Sam Judson : Wrox Technical Editor -/
 
Old October 29th, 2007, 08:12 AM
Registered User
 
Join Date: Sep 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by samjudson
 Firefox appears to match the local-name, without the prefix.

Have you tried just defining the CSS as

Play { }

or double defining them as

jmfns\:Play, Play {
}

/- Sam Judson : Wrox Technical Editor -/
Perfect. Thank you.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange behavior of Firefox 3 and hallo.xml PKHG BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 3 August 6th, 2008 10:32 AM
Css layout not work well in Firefox kumiko CSS Cascading Style Sheets 0 March 31st, 2008 10:27 AM
CSS style issue ok in Firefox but not in IE6 socoolbrewster CSS Cascading Style Sheets 1 September 22nd, 2006 10:01 AM
CSS Loads Slowly in IE 6.0/Fine in Firefox kwilliams CSS Cascading Style Sheets 3 December 14th, 2005 06:33 PM
Link Display Prob using CSS in IE6 / Firefox socoolbrewster CSS Cascading Style Sheets 3 September 7th, 2005 11:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.