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!

XML validation problem

Status
Not open for further replies.

tinggg

Technical User
May 15, 2004
69
NZ
Hi

When I use a url with more than one = symbol e.g.


the xml fails to validate. The reason given is that "the production 'entity ref' not satisfied"

- I looked up the entity-escape-character for = and got =
- I replaced the = with =

but that didn't work either.

Can anyone help me with where I am going wrong?

Many thanks
 
hi

Mmmm have come across another problem with a url with & in it:
When I change both '&' to & the xml validates as well- formed however the page returned is not the original one above:

When I edit the url changing only the second '&' to & the correct page is returned but the xml does not validate as well-formed:

When I edit the url changing only the first '&' to & the xml validates as well-formed but the original page is not returned.

I can't see any other characters in this url that needs to be escaped e.g.
& &
< &lt;
> &gt;
" &quot;
' &apos;

Can anyone else see anything else in this url that I need to escape:

Thanks again
 
Well, by viewing the actual page source you may discover that you have escaped the ampersand in the ampersand entity reference. At least that is what is wrong in your posting.

Look at your source with a text editor (not a browser) and see if you don't have two amp strings almost adjacent.

Tom Morrison
 
Hi

i'm really sorry but I don't know what you mean by 'escaped the ampersand in the ampersand entity reference'. I am linking to these pages and have not got access to their source code. When a link would not validate in my xml editor (Altova) I replaced all & with &amp;

The url has 3 instances of & so I made 3 replacemnets with &amp;

Is this incorrect?
 
The querystring part consists of name/value pairs separated by "&". In the xml text node, you replace each and every separator (&) by (&amp;). Am I missing something? Your postings sometimes show id=3788, sometimes id=6423 and partly replaced and partly not replaced? What is the story of it?
 
I think you are being confused by the rendition that you are seeing on a screen.

For example, in your post of [tt]30 Jul 07 19:47[/tt] one of the actual character strings has the following characters:
Code:
&amp;amp;
But the browser is rendering this as simply &amp; (as it should).

Your post of [tt]30 Jul 07 22:20[/tt] appears to be encoded correctly.

Tom Morrison
 
The querystring part consists of name/value pairs separated by "&". In the xml text node, you replace each and every separator (&) by (&amp;). Am I missing something? Your postings sometimes show id=3788, sometimes id=6423 and partly replaced and partly not replaced? What is the story of it?

The original url has 3x'&'

When I replace all the '&' with &amp; I get an error page:

Because I got an error page I tried changing one '&' at a time to see if this would work - when I did this I was taken to another webpage with the id=6423

Sorry for the confusion
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top