1<%
2 ' FCKeditor - The text editor for Internet - http://www.fckeditor.net
3 ' Copyright (C) 2003-2007 Frederico Caldeira Knabben
4 '
5 ' == BEGIN LICENSE ==
6 '
7 ' Licensed under the terms of any of the following licenses at your
8 ' choice:
9 '
10 '  - GNU General Public License Version 2 or later (the "GPL")
11 '    http://www.gnu.org/licenses/gpl.html
12 '
13 '  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14 '    http://www.gnu.org/licenses/lgpl.html
15 '
16 '  - Mozilla Public License Version 1.1 or later (the "MPL")
17 '    http://www.mozilla.org/MPL/MPL-1.1.html
18 '
19 ' == END LICENSE ==
20 '
21 ' This file include the functions that create the base XML output.
22%>
23<%
24
25Sub SetXmlHeaders()
26	' Cleans the response buffer.
27	Response.Clear()
28
29	' Prevent the browser from caching the result.
30	Response.CacheControl = "no-cache"
31
32	' Set the response format.
33	Response.CharSet		= "UTF-8"
34	Response.ContentType	= "text/xml"
35End Sub
36
37Sub CreateXmlHeader( command, resourceType, currentFolder, url )
38	' Create the XML document header.
39	Response.Write "<?xml version=""1.0"" encoding=""utf-8"" ?>"
40
41	' Create the main "Connector" node.
42	Response.Write "<Connector command=""" & command & """ resourceType=""" & resourceType & """>"
43
44	' Add the current folder node.
45	Response.Write "<CurrentFolder path=""" & ConvertToXmlAttribute( currentFolder ) & """ url=""" & ConvertToXmlAttribute( url ) & """ />"
46End Sub
47
48Sub CreateXmlFooter()
49	Response.Write "</Connector>"
50End Sub
51
52Sub SendError( number, text )
53	SetXmlHeaders
54
55	' Create the XML document header.
56	Response.Write "<?xml version=""1.0"" encoding=""utf-8"" ?>"
57
58	Response.Write "<Connector><Error number=""" & number & """ text=""" & Server.HTMLEncode( text ) & """ /></Connector>"
59
60	Response.End
61End Sub
62%>
63