Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Just starting but can't get validated 1

Status
Not open for further replies.

Jakea

Technical User
Mar 19, 2007
6
US
My first XML script is virtually copied from a tutorial but it comes up with validation errors that I can't find the solution to. Here's the basic code:<code>

<?xml version="1.0" ?>
<rss version="2.0">
<channel>
<title>A test feed</title>
<description>A sample description.</description>
<link>
<item>
<title>A sample item</title>
<description>An item everyone will want.</description>
<guid><link></item>

</channel>
</rss>

</code>
The validator doesn't like the last line (</rss), calling it a parsing error: "XML parsing error: <unknown>:18:0: not well-formed (invalid token)." I've tried all sorts of things - just can't figure it out.

That guid line was added to solve a 2nd problem.

Jake
 
It's not a validation error, which would require a DTD or schema. The XML is not well-formed: you have no opening tag for your </code> tag. (It complains about what follows the </rss> tag.)
 
The <code></code> tags aren't part of the XML program that I'm trying to get validated. I added that because I read someplace here that this tag was needed when code was part of the message. The program code in question starts with <?xml version="1.0" ?><rss version="2.0"> and ends with </rss>. Sorry for that confusion.

Jakea
 
The document, as presented, is well formed. Determining validity requires a DTD or XML Schema. The diagnostic makes no sense in this context; my guess is something else is happening.

The TGML tags are[ignore]
Code:
 and
[/ignore]. Note the square brackets. You may click on the "Process TGML" link for helpful information about TGML.

Tom Morrison
 
The validator I'm using, per the tutorial, is feedvalidator.org. Is there another place to do it? I have no idea what you mean by DTD or XML Schema. I'm totally new to this language. An explanation would be appreciated and/or your advice about what my next step should be toward testing the code and posting it for syndication. Thanks.

Jakea
 
Ok, you're doing RSS, which is a specific XML application. According to feedvalidator.org's description of what it considers valid, your code should be fine.

They say:

"If the feed exists, the server is fine, and the problem is reproducible, let us know on the feedvalidator-users mailing list."

So, here are your marching orders: ask *them*. (Not because you're unwelcome here, but because there's where you'll find the experts on that subject.)

And come back and tell us what you find out.
 
I seem to have worked this out, so I'm reporting as per request to do so. I did two things that provided a breakthrough:

1. Structure. I eliminated all blank lines except the ones after <channel> and before </channel>. I don't think this made a difference but haven't proven it one way or the other.

2. What I really think made the difference was my remembering that since I was using a DOS text editor, an EOL symbol was automatically included at the end. I believe this is what caused the final </rss> tag to be singled out as a problem. When I eliminated it, the script validated.

Hope this helps someone down the line.

If anyone would like to see my first RSS, try Feel free to join the syndication.

Cheers!

Jake
 
Good for you, Jake, and thanks for reporting back. I think you meant the Ctrl-Z at EOF, but you're probably right that it's the culprit. (Please tell us you aren't still using EDLIN! :)) The whitespace between tags is insignificant.
 
Hb:

Yes to Ctrl-Z. Fortunately, I can report I'm not using EDLIN and never have. But what I do use that's probably equally bad is SLED. I'm so used to it I've never been able to wean myself away. I have WORD but never got acclimated.
 
I'm sure everyone has his preference, but I've been hooked on Multi-Edit since DOS days. It's now in its tenth Windows version. Get a trial at
It's so customizable that you could probably make it look like SLED--the CUA keymap is still included.
 
Thanks, but I have no reason to change and no time to experiment.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top