XML and CSS -> Blank Screen :(

Discussion in 'XML' started by charly, Jan 8, 2004.

  1. charly

    charly Guest

    Greetings,

    I'm trying my hand at xml and css (no, I don't want to use XSL yet).

    So I got a test.xml :


    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <?xml-stylesheet href="styles.css" type="text/css"?>

    <Diaries>
    <name>
    testName
    </name>
    <name>
    testName the second
    </name>
    </Diaries>


    I got a styles.css defined as this :

    <meta http-equiv="content-style-type" content="text/css">

    diairies,name{
    display: block;
    padding: 0.75em;
    }


    now if open test.xml with IE6 or Firebird, nothing appears, my screen is
    blank yet the source is correct....

    I am definitively missing somehting obvious here :

    can someone help me please ?

    thx a bunch !!
     
    charly, Jan 8, 2004
    #1
    1. Advertising

  2. charly wrote:


    > I'm trying my hand at xml and css (no, I don't want to use XSL yet).
    >
    > So I got a test.xml :
    >
    >
    > <?xml version="1.0" encoding="ISO-8859-1" ?>
    > <?xml-stylesheet href="styles.css" type="text/css"?>
    >
    > <Diaries>
    > <name>
    > testName
    > </name>
    > <name>
    > testName the second
    > </name>
    > </Diaries>
    >
    >
    > I got a styles.css defined as this :
    >
    > <meta http-equiv="content-style-type" content="text/css">


    That line above is HTML markup and doesn't belong in a CSS stylesheet.

    > diairies,name{


    The element name above is Diaries and not diairies


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jan 8, 2004
    #2
    1. Advertising

  3. charly

    charly Guest

    Ok, I admit, I did a bad cut & paste :

    I did put DIARIES in both places and tried without the HTML markup but
    had not better luck :( :

    toto.xml follows :

    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <?xml-stylesheet href="styles.css" type="text/css"?>

    <DIAIRIES>
    <TARGET NAME="myNameIs"/>

    </DIAIRIES>


    CSS file :

    TARGET{
    display: block;
    color: #6A6A6A;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 8pt;
    font-weight:bold;
    }

    DIAIRIES{
    display: block;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 8pt;
    font-weight: normal;
    }



    thx anyway
     
    charly, Jan 8, 2004
    #3
  4. charly wrote:


    > I did put DIARIES in both places and tried without the HTML markup but
    > had not better luck :( :
    >
    > toto.xml follows :
    >
    > <?xml version="1.0" encoding="ISO-8859-1" ?>
    > <?xml-stylesheet href="styles.css" type="text/css"?>
    >
    > <DIAIRIES>
    > <TARGET NAME="myNameIs"/>
    >
    > </DIAIRIES>


    Hmm, there is no content in that XML file so the browser will indeed
    render a blank screen.
    Maybe you have again not copied what you played with but I suggest you
    try to make an example that you think doesn't work, upload it to a HTTP
    server and post the URL here.
    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jan 8, 2004
    #4
  5. charly

    charly Guest

    > Hmm, there is no content in that XML file so the browser will indeed
    > render a blank screen.
    > Maybe you have again not copied what you played with but I suggest you
    > try to make an example that you think doesn't work, upload it to a HTTP
    > server and post the URL here.


    First of all, Thank you very for your time and attention :)

    I did put exactly what I played with.
    But I seem to forget something very important in my xml file but I do
    not see what it is :(
    The point is that if i remove the css part, the borwser prints the
    structure of the document :(

    could you provide me with a wholly formed xml file please ?

    thx again !
     
    charly, Jan 8, 2004
    #5
  6. charly

    charly Guest

    > Hmm, there is no content in that XML file so the browser will indeed
    > render a blank screen.
    > Maybe you have again not copied what you played with but I suggest you
    > try to make an example that you think doesn't work, upload it to a HTTP
    > server and post the URL here.


    At last I understand my error :

    in xml, <ELEMENT name="tot"></ELEMENT> won't print anything
    I thought it would at last print "tot" but of course, not :(.

    I have to provide <ELEMENT name="tot">here</ELEMENT> to print "here"

    That's annoying ...

    My problem is that I have a huge xml file with a lot of elements where
    infos are held in attributes to make the document more human readable
    but the parser doesn't care : if element is empty, then he won't print it :(

    Would XSL help me there ?
     
    charly, Jan 8, 2004
    #6
  7. charly wrote:

    > > Hmm, there is no content in that XML file so the browser will indeed

    >
    >> render a blank screen.
    >> Maybe you have again not copied what you played with but I suggest you
    >> try to make an example that you think doesn't work, upload it to a
    >> HTTP server and post the URL here.

    >
    >
    > At last I understand my error :
    >
    > in xml, <ELEMENT name="tot"></ELEMENT> won't print anything
    > I thought it would at last print "tot" but of course, not :(.
    >
    > I have to provide <ELEMENT name="tot">here</ELEMENT> to print "here"
    >
    > That's annoying ...
    >
    > My problem is that I have a huge xml file with a lot of elements where
    > infos are held in attributes to make the document more human readable
    > but the parser doesn't care : if element is empty, then he won't print
    > it :(
    >
    > Would XSL help me there ?


    Yes, XSLT can transform you XML to HTML and put any information inside
    XML attributes into some HTML element so that the information is rendered.
    Or you could use XSLT to transform your XML with attributes to some XML
    with elements containing content.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jan 8, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. happyinst
    Replies:
    1
    Views:
    464
    happyinst
    Jul 10, 2003
  2. =?Utf-8?B?QW1pcg==?=

    Large Blank Space on the Screen

    =?Utf-8?B?QW1pcg==?=, Nov 10, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,426
  3. Alex Molochnikov
    Replies:
    11
    Views:
    2,741
    Mohun Biswas
    May 4, 2004
  4. tom watson

    print.css and screen.css

    tom watson, Sep 9, 2003, in forum: HTML
    Replies:
    1
    Views:
    484
    Jukka K. Korpela
    Sep 9, 2003
  5. Vincent
    Replies:
    0
    Views:
    402
    Vincent
    Sep 18, 2008
Loading...

Share This Page