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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jake Barnes

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

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



    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

    #2
    Re: RSS 2.0 question - why are &quot;=&quot ; characters not allowed in URLs, even inside the &lt;link&gt; tag?


    Jake Barnes wrote:[color=blue]
    > 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?[/color]

    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.c om/index.php?whatP age=showOneTag. php&whatTag=pho tography</link>
    --------------------------------------------------------------------------------------------------------^

    Comment

    • Nadeem

      #3
      Re: RSS 2.0 question - why are &quot;=&quot ; characters not allowed in URLs, even inside the &lt;link&gt; tag?

      "Jake Barnes" <lkrubner@geoci ties.com> wrote in message
      news:1135100026 .295253.247750@ g14g2000cwa.goo glegroups.com.. .[color=blue]
      > 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.c om/index.php?whatP age=showOneTag. php&whatTag=pho tography</link>
      > --------------------------------------------------------------------------------------------------------^[/color]


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

      HTH

      Nadeem


      Comment

      • Michael Winter

        #4
        Re: RSS 2.0 question - why are &quot;=&quot ; characters not allowed in URLs,even inside the &lt;link&gt; tag?

        On 20/12/2005 17:33, Jake Barnes wrote:
        [color=blue]
        > Jake Barnes wrote:[/color]

        [snip]
        [color=blue][color=green]
        >> 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.[/color][/color]

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

        [snip]
        [color=blue]
        > XML Parsing Error: not well-formed
        >
        > Location: http://www.tagcastle.com/rss/photography.xml
        > Line Number 7, Column 77:
        >
        > <link>http://www.tagcastle.c om/index.php?whatP age=showOneTag. php&whatTag=pho tography</link>[/color]

        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.

        Comment

        • Peter Flynn

          #5
          Re: RSS 2.0 question - why are &quot;=&quot ; characters not allowed in URLs, even inside the &lt;link&gt; tag?

          Jake Barnes wrote:
          [color=blue]
          > Very odd. Check out this RSS feed that my PHP script just built:
          >
          > http://www.tagcastle.com/rss/photography.xml[/color]

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

          Web Server at tagcastle.com

          ///Peter

          Comment

          Working...