XML and CSS -> Blank Screen :(

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • charly

    #1

    XML and CSS -> Blank Screen :(

    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.cs s" 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 !!

  • Martin Honnen

    #2
    Re: XML and CSS -&gt; Blank Screen :(



    charly wrote:

    [color=blue]
    > 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.cs s" 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">[/color]

    That line above is HTML markup and doesn't belong in a CSS stylesheet.
    [color=blue]
    > diairies,name{[/color]

    The element name above is Diaries and not diairies


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    • charly

      #3
      Re: XML and CSS -&gt; Blank Screen :(

      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.cs s" 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

      Comment

      • Martin Honnen

        #4
        Re: XML and CSS -&gt; Blank Screen :(



        charly wrote:

        [color=blue]
        > 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.cs s" type="text/css"?>
        >
        > <DIAIRIES>
        > <TARGET NAME="myNameIs"/>
        >
        > </DIAIRIES>[/color]

        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/

        Comment

        • charly

          #5
          Re: XML and CSS -&gt; Blank Screen :(

          > Hmm, there is no content in that XML file so the browser will indeed[color=blue]
          > 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.[/color]

          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 !

          Comment

          • charly

            #6
            Re: XML and CSS -&gt; Blank Screen :(

            > Hmm, there is no content in that XML file so the browser will indeed[color=blue]
            > 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.[/color]

            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 ?


            Comment

            • Martin Honnen

              #7
              Re: XML and CSS -&gt; Blank Screen :(



              charly wrote:
              [color=blue][color=green]
              > > Hmm, there is no content in that XML file so the browser will indeed[/color]
              >[color=green]
              >> 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.[/color]
              >
              >
              > 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 ?[/color]

              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/

              Comment

              Working...