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!

Problem with saving links in XML file 1

Status
Not open for further replies.

Delameko

Programmer
Oct 14, 2003
37
GB
Hi, I hope you can help me.

I'm try to save a link to my xml file. The link is like this:




When I try and load the XML file I get the following error:

Code:
XML Parsing Error: not well-formed
Location: [URL unfurl="true"]http://content.thisis.co.uk/EditorChoice/comments.xml[/URL]
Line Number 9, Column 86:
		<link>[URL unfurl="true"]http://www.thisisnottingham.co.uk/displayNode.jsp?nodeId=133942&command=displayContent&sourceNode=229135&home=yes&more_nodeId1=133951&contentPK=16627627</link>[/URL]
---------------------------------------------------------------------------------------------------^

Its actually pointing to this bit: ...&command=display... (to the = sign after command)


Any ideas? Thanks.
 
[1] If you are editing the source file by hand, you can make sure to let the parser knowing the text are character data. Like this. (I shorten it to only 2 query strings to avoid wide-post!)
[tt]
<link>[red]&amp;[/red]command=displayContent[red]&smp;[/red][green]...[/green]</link>
[/tt]
[2] If you are building the source via automation application, you write the text by first replacing "&" (negative look-ahead: not following by "amp;") by "&amp;" in the language of regular expression.
 
[1'] My original intention is to advise in case you edit the source manually, use <![CDATA[...]]> tagging to let the parser know it contains character data. In this form, no need to escape the ampersand (&). It is this.
[tt]
<link>[blue]<![CDATA[[/blue][blue]]]>[/blue]</link>
[/tt]
When typing, I was just carried away into escaping the ampersand!

(Note: the forum will auto modify the display of ampersand (&) in the hyperlink. What you see amp; or ; in the display are in fact artifacts.)
 

Thank you Tsuji, that got me on the right track.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top