Question

i am using sitemap_generator gem and i have a problem with alternates

this is the generating of the sitemap:

alternates = [ #adding mobile deep link
      {lang: 'en',
       href: "http://mysite/linker?view=user&user_id=1234"}
  ]

add user_path, :changefreq => 'weekly', :priority => 0.6, :images => user_images, :alternates => alternates

but in the sitemap xml file, i get

<xhtml:link rel="alternate" hreflang="en" href="http://mysite/linker?view=user&amp;cat_id=1234"/>

so it replaces the & with &amp;

is there a way to leave it as is? with regular & ?

Was it helpful?

Solution

This isn't possible - a naked ampersand would be invalid xml. Literal ampersands in xml have to be replaced with &amp;

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top