RSS 2.0 question - why are "=" characters not allowed in URLs, even inside the <link> tag?

Discussion in 'XML' started by Jake Barnes, Dec 20, 2005.

  1. Jake Barnes

    Jake Barnes Guest

    Very odd. Check out this RSS feed that my PHP script just built:

    http://www.tagcastle.com/rss/photography.xml

    When I had a straight URL in the <link> tag, or the <comment> tag, then
    "=" character drew an error and caused my XML to be not-well-formed. So
    I hit it with the PHP command rawurlencode, and now it draws no error,
    but it no longer works as a link.

    What did I do wrong?
    Jake Barnes, Dec 20, 2005
    #1
    1. Advertising

  2. Jake Barnes

    Jake Barnes Guest

    Jake Barnes wrote:
    > Very odd. Check out this RSS feed that my PHP script just built:
    >
    > http://www.tagcastle.com/rss/photography.xml
    >
    > When I had a straight URL in the <link> tag, or the <comment> tag, then
    > "=" character drew an error and caused my XML to be not-well-formed. So
    > I hit it with the PHP command rawurlencode, and now it draws no error,
    > but it no longer works as a link.
    >
    > What did I do wrong?


    I should add, when I don't hit the query string with rawurlencode(),
    I"m getting this error:

    XML Parsing Error: not well-formed

    Location: http://www.tagcastle.com/rss/photography.xml
    Line Number 7, Column 77:

    <link>http://www.tagcastle.com/index.php?whatPage=showOneTag.php&whatTag=photography</link>
    --------------------------------------------------------------------------------------------------------^
    Jake Barnes, Dec 20, 2005
    #2
    1. Advertising

  3. Jake Barnes

    Nadeem Guest

    "Jake Barnes" <> wrote in message
    news:...
    > I should add, when I don't hit the query string with rawurlencode(),
    > I"m getting this error:
    >
    > XML Parsing Error: not well-formed
    >
    > Location: http://www.tagcastle.com/rss/photography.xml
    > Line Number 7, Column 77:
    >
    > <link>http://www.tagcastle.com/index.php?whatPage=showOneTag.php&whatTag=photography</link>
    > --------------------------------------------------------------------------------------------------------^



    Perhaps it's the & that's causing the problem - try &amp; instead

    HTH

    Nadeem
    Nadeem, Dec 20, 2005
    #3
  4. Re: RSS 2.0 question - why are "=" characters not allowed in URLs,even inside the <link> tag?

    On 20/12/2005 17:33, Jake Barnes wrote:

    > Jake Barnes wrote:


    [snip]

    >> When I had a straight URL in the <link> tag, or the <comment> tag, then
    >> "=" character drew an error and caused my XML to be not-well-formed.


    This has nothing to do with an equals symbol, though it took your
    follow-up to identify the problem clearly.

    [snip]

    > XML Parsing Error: not well-formed
    >
    > Location: http://www.tagcastle.com/rss/photography.xml
    > Line Number 7, Column 77:
    >
    > <link>http://www.tagcastle.com/index.php?whatPage=showOneTag.php&whatTag=photography</link>


    In XML (HTML, too) an ampersand (&) marks the beginning of an entity
    reference. All 'Name' characters (in brief: mainly letters and numbers)
    after that, up to a semicolon (;)[1], identify that entity. The entity
    reference above (&whatTag;, I suppose) not only fails to end with a
    semicolon, but doesn't exist anyway.

    Long story short, the ampersand needs to be changed to an entity
    reference, &amp;, just as it would need to be in HTML.

    Mike


    [1] As I understand it, in SGML, and therefore HTML
    (technically), the semicolon wasn't necessary, and the first
    character that didn't match the 'name' token would end the
    reference. XML is more strict, however.

    --
    Michael Winter
    Prefix subject with [News] before replying by e-mail.
    Michael Winter, Dec 20, 2005
    #4
  5. Jake Barnes

    Peter Flynn Guest

    Jake Barnes wrote:

    > Very odd. Check out this RSS feed that my PHP script just built:
    >
    > http://www.tagcastle.com/rss/photography.xml


    Not Found
    The requested document was not found on this server.

    Web Server at tagcastle.com

    ///Peter
    Peter Flynn, Dec 21, 2005
    #5
  6. Well, I found the file again at
    http://www.autostratus.com/rss/photography.xml.

    The file is still not valid, or even well-formed:
    - use &amp; instead of &samp; (remove 's')
    - the text betwee the webMaster tags is not valid, it should be an e-mail
    address
    - remove <author></author>

    - gerben abbink
    www.xmlblueprint.com



    "Jake Barnes" <> wrote in message
    news:...
    > Very odd. Check out this RSS feed that my PHP script just built:
    >
    > http://www.tagcastle.com/rss/photography.xml
    >
    > When I had a straight URL in the <link> tag, or the <comment> tag, then
    > "=" character drew an error and caused my XML to be not-well-formed. So
    > I hit it with the PHP command rawurlencode, and now it draws no error,
    > but it no longer works as a link.
    >
    > What did I do wrong?
    >
    xmlBlueprint Team, Dec 21, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shruds
    Replies:
    1
    Views:
    779
    John C. Bollinger
    Jan 27, 2006
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,806
    Smokey Grindel
    Dec 2, 2006
  3. Adam Monsen

    JDBC URLs ...not really URLs?

    Adam Monsen, Feb 6, 2009, in forum: Java
    Replies:
    11
    Views:
    6,179
    Adam Monsen
    Feb 8, 2009
  4. Jonathan Groll
    Replies:
    1
    Views:
    259
    Kouhei Sutou
    Jun 27, 2009
  5. Iñaki Baz Castillo
    Replies:
    13
    Views:
    496
    Iñaki Baz Castillo
    May 1, 2011
Loading...

Share This Page