WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 XLoadTree "src" bug?, Tim St.Clair, January 15, 2003
     Re:XLoadTree , Erik Arvidsson, January 15, 2003
         Re:XLoadTree , Mario Rodrigues, January 15, 2004

Subject: Re:XLoadTree From: Erik Arvidsson Date: January 15, 2003
This is not a bug in XLoadTree. It is a bug in your generated XML file. The result is not a well formed XML file.

Response.Write "src=""gettree.asp?Id=" & rs("Id") & "&Dest=" & Dest & """ "

Note that '&' starts an entity and must be one of the available entities for the document (or one of the predefined; amp, lt, gt, apos, quot).

erik

---------------------------------------------------------

I'm seeing an error when using the src param in XLoadTree if it has an ampersand in it. I'm pointing to an asp file which builds the xml. Here's the core code for building the xml file (gettree.asp):
Response.ContentType = "text/xml"
Id = Request.QueryString("Id")
Dest = Request.QueryString("Dest")
sql = "SELECT Name, Id FROM Categories WHERE ParentId = " & Id & " ORDER BY txtName"
rs.Open SQL, conn, 1, 3
Response.Write "<?xml version=""1.0"" ?>"
Response.Write "<tree>"
Do While Not rs.EOF
Response.Write "<tree text=""" & rs("Name") & """ "
Response.Write "src=""gettree.asp?Id=" & rs("Id") & "&Dest=" & Dest & """ "
Response.Write "/>"
rsL.MoveNext
Loop
Response.Write "</tree>"
rsL.Close
You can see "src" pointing to itself with a querystring containing a ? and a ampersand (&). If I get rid of "&dest=" etc and just have it without the extra querystring parameter, it works fine. With an & (or &amp; ) in the src, the xml file fails to load. If you remove the response.contenttype and view the xml in IE, it looks well-formed and doesn't throw an error.
Any ideas?



Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX