Web Analytics Made Easy -
StatCounter Image DTD Declaration - CodingForum

Announcement

Collapse
No announcement yet.

Image DTD Declaration

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Image DTD Declaration

    Wow, searched all through the forums. This must be so simple nobody even needs to ask about it [except me]. What is the proper [or appropriate] DTD declaration to get an image to show up?

    Thanks -
    Last edited by Scriptbanger; Sep 26, 2006, 07:53 PM. Reason: No Responses
    .
    + Christ is the Rock - Rock On!

  • #2
    It would help if you posted the current code you have. An image should show up no matter unless of course you are getting the filename wrong.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

    Comment


    • #3
      Oops . . .

      Sorry 'bout that. Here is my code. The text shows up but the images [and the html bold tags] don't.

      DTD:
      Code:
      <!ELEMENT NEWS ANY>
      <!ELEMENT HEADLINE (#PCDATA)>
      <!ELEMENT BYLINE (#PCDATA)>
      <!ELEMENT AUTHOR (#PCDATA)>
      <!ELEMENT DATE (#PCDATA)>
      <!ELEMENT STORY (#PCDATA)>
      <!ELEMENT IMAGES (#PCDATA)>
      XSL
      Code:
      <?xml version="1.0"?>
      <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
       <xsl:template match="/">
        <xsl:apply-templates select="NEWS/HEADLINE" />
        <xsl:apply-templates select="NEWS/BYLINE" />
        <xsl:apply-templates select="NEWS/AUTHOR" />
        <xsl:apply-templates select="NEWS/DATE" />
        <xsl:apply-templates select="NEWS/STORY" />
        <xsl:apply-templates select="NEWS/IMAGES" />
       </xsl:template>
       <xsl:template match="HEADLINE">
        <DIV STYLE="display:'block'; font-family:'arial'; color:'#000080'; font-weight:'600'; font-size:'22'">
        <xsl:value-of />
        </DIV>
       </xsl:template>
       <xsl:template match="BYLINE">
        <DIV STYLE="display:'block'; font-family:'arial'; color:'#000080'; font-weight:'200'; font-size:'15'">
        <xsl:value-of />
        </DIV>
       </xsl:template>
       <xsl:template match="AUTHOR">
        <SPAN STYLE="display:'block'; font-family:'arial'; color:'#000080'; font-weight:'100'; font-size:'10'">
        <xsl:value-of />
        </SPAN>
       </xsl:template>
       
       <xsl:template match="DATE">
        <SPAN STYLE="display:'block'; font-family:'arial'; color:'#000080'; font-weight:'100'; font-size:'10'">
        <xsl:value-of />
        </SPAN>
       </xsl:template>
       
       <xsl:template match="STORY">
        <DIV STYLE="display:'block'; font-family:'arial'; color:'#000080'; font-weight:'50'; font-size:'10'">
        <xsl:value-of />
        </DIV>
       </xsl:template>
       
       <xsl:template match="IMAGES">
        <IMAGE STYLE="display:block; visibility:visible; height:auto; width:auto;">
        <xsl:value-of />
        </IMAGE>
       </xsl:template>
      </xsl:stylesheet>
      XML
      Code:
      <?xml version="1.0" encoding="iso-8859-1"?>
      <?DOCTYPE LANGLIST SYSTEM "index.dtd"?>
      <?xml-stylesheet type="text/xsl" href="index.xsl"?>
      <NEWS>
      <HEADLINE>Big Headline Here</HEADLINE>
      <BYLINE>Smaller Byline Here</BYLINE>
      <AUTHOR>Author Here <DATE>Date Here</DATE></AUTHOR>
      <STORY>
      <b>Story Part 1 Here</b>: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec sagittis eros vitae justo. In quis felis in lectus scelerisque placerat. Vivamus ante augue, egestas ac, fermentum at, imperdiet et, pede. Donec laoreet feugiat est. Phasellus volutpat diam ac augue. Cras venenatis aliquet diam. Cras tristique nisl non tellus. Donec sagittis massa sed risus. Nullam molestie. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Nam auctor, purus in pretium mattis, tellus erat pharetra nibh, ut scelerisque nibh nunc eu dui. In eget erat eu elit accumsan pulvinar. Etiam consectetuer scelerisque pede. Pellentesque eu libero et massa tincidunt accumsan. Vestibulum tristique pede quis odio.
      <IMAGES>
       <IMGOP type="file" src="img001.jpg"></IMGOP>
      </IMAGES>
      <b>Story Part 2 Here</b>: Sed lacinia. Ut diam nibh, adipiscing vel, pharetra vel, interdum non, libero. Nunc eget ante ut dolor vestibulum tempus. Sed ornare nisl suscipit neque. Fusce eros. Etiam dignissim consequat tortor. Nam ultrices dapibus odio. Integer bibendum. Etiam ut eros. Donec tempor mauris in turpis. Suspendisse luctus velit eleifend nisi. Suspendisse felis mi, porttitor at, pretium eu, vehicula eget, neque. Vivamus tincidunt, ipsum ut convallis viverra, justo diam varius justo, in posuere tortor sem at sem. Vivamus tincidunt sollicitudin dolor. Etiam suscipit ipsum quis sapien. Quisque sed massa a tellus tempus interdum. Integer sollicitudin ante quis purus. Fusce vitae urna eu quam accumsan condimentum. Proin nunc. Nam erat quam, gravida id, blandit id, fringilla sit amet, pede.
      <IMAGES>
       <IMGOP type="file" src="img002.jpg"></IMGOP>
      </IMAGES>
      <b>Story Part 3 Here</b>: Nulla justo nisi, ornare in, convallis eget, mattis vitae, quam. Proin vitae quam in orci dapibus interdum. Donec quis lacus. Praesent auctor ligula eu justo. Cras eleifend augue in urna. Nulla nunc. Integer mauris ante, mollis sed, lobortis molestie, dignissim ut, lorem. Nulla facilisi. Donec risus ipsum, mollis laoreet, porttitor vel, imperdiet porta, tellus. Praesent vitae sapien.
      </STORY>
      </NEWS>
      .
      + Christ is the Rock - Rock On!

      Comment


      • #4
        Shouldn't that be <!DOCTYPE NEWS SYSTEM "index.dtd"> ?
        "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
        June 30, 2001
        author, ES-Membrane project (Github Pages site)
        author, Verbosio prototype XML Editor
        author, JavaScript Developer's Dictionary
        https://alexvincent.us/blog

        Comment


        • #5
          Yup. I was working with an XML example and forgot to change that. It's fixed now but apparently didn't make any difference. The page still displays the same.

          Fixed XML:
          Code:
          <?xml version="1.0" encoding="iso-8859-1"?>
          <!DOCTYPE NEWS SYSTEM "index.dtd">
          <?xml-stylesheet type="text/xsl" href="index.xsl"?>
          <NEWS>
          <HEADLINE>Big Headline Here</HEADLINE>
          <BYLINE>Smaller Byline Here</BYLINE>
          <AUTHOR>Author Here <DATE>Date Here</DATE></AUTHOR>
          <STORY>
          <b>Story Part 1 Here</b>: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec sagittis eros vitae justo. In quis felis in lectus scelerisque placerat. Vivamus ante augue, egestas ac, fermentum at, imperdiet et, pede. Donec laoreet feugiat est. Phasellus volutpat diam ac augue. Cras venenatis aliquet diam. Cras tristique nisl non tellus. Donec sagittis massa sed risus. Nullam molestie. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Nam auctor, purus in pretium mattis, tellus erat pharetra nibh, ut scelerisque nibh nunc eu dui. In eget erat eu elit accumsan pulvinar. Etiam consectetuer scelerisque pede. Pellentesque eu libero et massa tincidunt accumsan. Vestibulum tristique pede quis odio.
          <IMAGES>
           <IMGOP type="file" src="img001.jpg"></IMGOP>
          </IMAGES>
          <b>Story Part 2 Here</b>: Sed lacinia. Ut diam nibh, adipiscing vel, pharetra vel, interdum non, libero. Nunc eget ante ut dolor vestibulum tempus. Sed ornare nisl suscipit neque. Fusce eros. Etiam dignissim consequat tortor. Nam ultrices dapibus odio. Integer bibendum. Etiam ut eros. Donec tempor mauris in turpis. Suspendisse luctus velit eleifend nisi. Suspendisse felis mi, porttitor at, pretium eu, vehicula eget, neque. Vivamus tincidunt, ipsum ut convallis viverra, justo diam varius justo, in posuere tortor sem at sem. Vivamus tincidunt sollicitudin dolor. Etiam suscipit ipsum quis sapien. Quisque sed massa a tellus tempus interdum. Integer sollicitudin ante quis purus. Fusce vitae urna eu quam accumsan condimentum. Proin nunc. Nam erat quam, gravida id, blandit id, fringilla sit amet, pede.
          <IMAGES>
           <IMGOP type="file" src="img002.jpg"></IMGOP>
          </IMAGES>
          <b>Story Part 3 Here</b>: Nulla justo nisi, ornare in, convallis eget, mattis vitae, quam. Proin vitae quam in orci dapibus interdum. Donec quis lacus. Praesent auctor ligula eu justo. Cras eleifend augue in urna. Nulla nunc. Integer mauris ante, mollis sed, lobortis molestie, dignissim ut, lorem. Nulla facilisi. Donec risus ipsum, mollis laoreet, porttitor vel, imperdiet porta, tellus. Praesent vitae sapien.
          </STORY>
          </NEWS>
          .
          + Christ is the Rock - Rock On!

          Comment


          • #6
            Is it outputting HTML? What's the output, post-transformation, look like? What content type is it served with?

            What CSS styles the end result?
            "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
            June 30, 2001
            author, ES-Membrane project (Github Pages site)
            author, Verbosio prototype XML Editor
            author, JavaScript Developer's Dictionary
            https://alexvincent.us/blog

            Comment


            • #7
              Is it outputting HTML?
              No. HTML markup is being ignored.

              What's the output, post-transformation, look like?
              The output display is correct as per the XSL except that the images aren't showing up and the HTML markup is being ignored.

              What content type is it served with?
              Not sure what is meant here. Right now it is just a static XML page with attached DTD and XSL.

              What CSS styles the end result?
              The styles are set by the XSL.

              Hopefully I answered your questions correctly. I appologize if I seem a little ignorant. I am new to XML. I don't have a problem doing my homework but I can't seem to find anything on inserting a plain, static image into a simple XML document. Everything seems to be about creating Dynamic and/or Ajax slideshows and media presentations. If anyone knows of a good, basic XML tutorial that covers working with simple graphics and images I would be tremendously grateful and . . . I could quit bugging you all.
              .
              + Christ is the Rock - Rock On!

              Comment


              • #8
                http://www.w3schools.com/xml/
                Have you tried putting your tags in lowercase? I do believe XML needs to be all lowercase.
                Last edited by _Aerospace_Eng_; Sep 28, 2006, 02:10 PM.
                ||||If you are getting paid to do a job, don't ask for help on it!||||

                Comment


                • #9
                  Changed it all to lowercase. Still the same output.

                  Maybe I am entirely on the wrong track. Let's try a different question.

                  I need to put a static image into an XML document. What's the simplest way to do that?
                  .
                  + Christ is the Rock - Rock On!

                  Comment


                  • #10
                    Originally posted by _Aerospace_Eng_ View Post
                    http://www.w3schools.com/xml/
                    Have you tried putting your tags in lowercase? I do believe XML needs to be all lowercase.
                    No, it doesn't. The only case requirement is for the elements to be consistent in their case (including in XSLTs and DTDs if they exist).
                    Geoffrey Sneddon

                    Comment


                    • #11
                      Scriptbanger, can you save the post-transformation results to a file and post the contents of that file here? I have a sneaking suspicion your IMAGE elements are being treated as vanilla XML, without any appropriate styling to tell the browser to render an actual image.
                      "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
                      June 30, 2001
                      author, ES-Membrane project (Github Pages site)
                      author, Verbosio prototype XML Editor
                      author, JavaScript Developer's Dictionary
                      https://alexvincent.us/blog

                      Comment


                      • #12
                        Code:
                        <img xmlns="http://www.w3.org/1999/xhtml" src="foo.png" alt=""/>

                        Comment


                        • #13
                          I tried zcorpan's code with the same results [no images].

                          Alex Vincent. I hope this is what you meant. I saved the output in a pdf format. As you can see, I can alter the text but images [and HTML] dont show.
                          Attached Files
                          .
                          + Christ is the Rock - Rock On!

                          Comment


                          • #14
                            *sigh* No. Can you post a link to the sample XML file as it goes through transformation?
                            "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
                            June 30, 2001
                            author, ES-Membrane project (Github Pages site)
                            author, Verbosio prototype XML Editor
                            author, JavaScript Developer's Dictionary
                            https://alexvincent.us/blog

                            Comment

                            Working...
                            X