O'Reilly Forums: Ch. 7 Xhtml Verification - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Ch. 7 Xhtml Verification

#1 User is offline   Rachel12 

  • New Member
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 31-January 12

Posted 07 February 2012 - 02:20 AM

Hi. I'm working on Ch. 7 verifying xhtml but I can't seem to get it to validate. Does anyone see what I'm missing?

This is the error I'm getting:

Line 41, Column 26: character "<" is the first character of a delimiter but occurred as data <br> Passing cars, < /br>



This message may appear in several cases:
•You tried to include the "<" character in your page: you should escape it as "&lt;"
•You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&amp;", which is always safe.
•Another possibility is that you forgot to close quotes in a previous tag.


and this is the code I'm using:

   <p>
      I saw some Burma Shave style signs on the side of the
      road today:
    </p>
    <blockquote>
      <p>
      <br> Passing cars, < /br>
      <br> When you can't see, < /br>
      <br> May get you, < /br>
      <br> A glimpse, < /br>
      <br> Of eternity. < /br>
      </p>
    </blockquote>
    <p>
      I definitely won't be passing any cars.
    </p>


I have a feeling it's something obvious that I'm missing (hopefully.) Any help would be appreciated. Thanks!
0

#2 User is offline   digby_36775 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 07-February 12

Posted 07 February 2012 - 02:37 AM

It might be the space in < /br> try </br>.
0

#3 User is offline   Rachel12 

  • New Member
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 31-January 12

Posted 07 February 2012 - 03:23 AM

Thanks, I tried that but it actually returns with more errors. I'll keep looking.

Appreciate the response. :-)
0

#4 User is offline   Rachel12 

  • New Member
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 31-January 12

Posted 07 February 2012 - 09:03 PM

Yes, it's a poem and the example used br unless they changed something and I missed it. Here is the complete code I'm using.

<!DOCTYPE html 
	PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
  	 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>My Trip Around the USA on a Segway</title>
  </head>
  <body>

    <h1>Segway'n USA</h1>
    <p>
      Documenting my trip around the US on my very own Segway!
    </p>

    <h2>August 20, 2005</h2>
    <p>
<img src="images/segway2.jpg" alt="Me any my Segway in New Mexico" />
</p>
    <p>
      Well I made it 1200 miles already, and I passed
      through some interesting places on the way: 
    </p>

    <ol>
      <li>Walla Walla, WA</li> 
      <li>Magic City, ID</li> 
      <li>Bountiful, UT</li>
      <li>Last Chance, CO</li>
      <li>Truth or Consequences, NM</li>
      <li>Why, AZ</li> 
    </ol>

    <h2>July 14, 2005</h2>
    <p>
      I saw some Burma Shave style signs on the side of the
      road today:
    </p>
    <blockquote>
      <p>
      <br> Passing cars, < /br>
      <br> When you can't see, < /br>
      <br> May get you, < /br>
      <br> A glimpse, < /br>
      <br> Of eternity. < /br>
      </p>
    </blockquote>
    <p>
      I definitely won't be passing any cars.
    </p>

    <h2>June 2, 2005</h2>
    <p>
<img src="images/segway1.jpg" alt="The first day of the trip" /></p>
    <p>
      My first day of the trip!  I can't believe I finally got
      everything packed and ready to go.  Because I'm on a Segway,
      I wasn't able to bring a whole lot with me:
    </p>
    <ul>
      <li>cellphone</li> 
      <li>iPod</li>
      <li>digital camera</li>
      <li>and a protein bar</li>
    </ul>
    <p>
       Just the essentials.  As
      Lao Tzu would have said, <q>A journey of a 
      thousand miles begins with one Segway.</q>
    </p>
  </body>
</html>


Maybe it's something higher up.

This post has been edited by Rachel12: 07 February 2012 - 09:04 PM

0

#5 User is offline   Rachel12 

  • New Member
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 31-January 12

Posted 07 February 2012 - 11:51 PM

thank you :) I took out the additional
< /br> 
but still nothing. I also tried just using
 <br/ > 
and that didn't do anything either.

I'll look for an answer key and stop bothering you all. Thank you for the responses, appreciate it.

Rachel.

This post has been edited by Rachel12: 07 February 2012 - 11:51 PM

0

#6 User is offline   Rachel12 

  • New Member
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 31-January 12

Posted 08 February 2012 - 05:05 AM

Hi it's me again. I just wanted to mention that I figured it out. Apparently I had the br on the wrong side like a genius. Thanks again for all the help! Here's the final code (the correct one - YABOY!)

<!DOCTYPE html 
	PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
  	 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>My Trip Around the USA on a Segway</title>
  </head>
  <body>

    <h1>Segway'n USA</h1>
    <p>
      Documenting my trip around the US on my very own Segway!
    </p>

    <h2>August 20, 2005</h2>
    <p>
<img src="images/segway2.jpg" alt="Me any my Segway in New Mexico" />
</p>
    <p>
      Well I made it 1200 miles already, and I passed
      through some interesting places on the way: 
    </p>

    <ol>
      <li>Walla Walla, WA</li> 
      <li>Magic City, ID</li> 
      <li>Bountiful, UT</li>
      <li>Last Chance, CO</li>
      <li>Truth or Consequences, NM</li>
      <li>Why, AZ</li> 
    </ol>

    <h2>July 14, 2005</h2>
    <p>
      I saw some Burma Shave style signs on the side of the
      road today:
    </p>
    <blockquote>
      <p>
       Passing cars,<br />
       When you can't see, <br />
       May get you, <br />
       A glimpse,<br />
       Of eternity.<br />
      </p>
    </blockquote>
    <p>
      I definitely won't be passing any cars.
    </p>

    <h2>June 2, 2005</h2>
    <p>
<img src="images/segway1.jpg" alt="The first day of the trip" /></p>
    <p>
      My first day of the trip!  I can't believe I finally got
      everything packed and ready to go.  Because I'm on a Segway,
      I wasn't able to bring a whole lot with me:
    </p>
    <ul>
      <li>cellphone</li> 
      <li>iPod</li>
      <li>digital camera</li>
      <li>and a protein bar</li>
    </ul>
    <p>
       Just the essentials.  As
      Lao Tzu would have said, <q>A journey of a 
      thousand miles begins with one Segway.</q>
    </p>
  </body>
</html>

0

#7 User is offline   Tweezy85 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 12-May 12

Posted 12 May 2012 - 03:48 PM

rachel12, how do you make your coding different colors like that? what text editor are you using?
0

#8 User is offline   rdej3354 

  • New Member
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 12-May 12

Posted 20 May 2012 - 09:02 PM

Tweezy,

Put the code samples in the square brackets, similar to <code> and </code>, but use the square instead. The bulletin board will add the coloration to the code.

If you want syntax highlighting...

Open Source: For editing, I typically use vim or gvim, though it may be a bit more difficult to pick up, given it's UNIX origins. I also have heard about a "jEdit" written in Java a coworker of mine uses.

Some commercially available options include UltraEdit and the editors built into Microsoft Visual Studio. For MSVS, look for an "express edition", which you should be able to download free of charge with some feature limitations when it comes to application development.

It does make it much easier to see what you're working on and spot mistakes.

Take care...

--Robert
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users