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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Probably a dumb question

Status
Not open for further replies.

mtarby

Programmer
Feb 19, 2003
89
US
Let me preface by saying, this is my first crack at doing anything with XML.

I'm trying to create a rss feed based on our site's news database content. My first problem is that some of the entries in the database contain html characters - the two I don't know how to escape or encode (if I'm using the correct term - I've discovered that a little knowledge is a dangerous thing) are <BR> and <a href>

For instance, this is the error I'm currently getting:

Code:
End tag 'description' does not match the start tag 'br'. Error processing resource '[URL unfurl="true"]http://www.lemoyne.edu/admission/rss/news.xml'.[/URL] Line 26, Position 451

Is it possible to do? Is there a resource someone could direct me to for future reference?

Thanks in advance for any help/direction!

Michelle
 
This is caused by the fact that rules for xml are stricter then for html. It is possible to write html that is also valid xml, but usually it is not.
The problem is that xml consists of nested nodes, like:
<A>
<B>Hallo</B>
<C/>
</A>
In html you can write:
<body>
blabla
<br>
blabla
</body>
In xml that is illegal, because a <br> node is opened but never closed.

If you cant control the way the html in the database is created, don't try and treat it as xml: it isn't.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top