Consultor Eletrônico



Kbase 20563: How to Change the Content-type to text/xml in WebSpeed
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

GOAL:

How to Change the Content-type to text/xml in WebSpeed to generate XML.

FACT(s) (Environment):

WebSpeed 3.x

FIX:

To change the content-type generated by Progress WebSpeed to text/xml in order to generate XML files from WebSpeed, this Solutions should be considered.

To change the content-type in WebSpeed, the following methods can be used:
- A CGI wrapper procedure:

You can use the statement output-content-type("text/xml").

For example:

/* testxml.p */
{src/web/method/wrap-cgi.i}

output-content-type("text/xml").

{&OUT} '<?xml version="1.0"?>' SKIP.
{&OUT} '<xmldata>' SKIP.
{&OUT} '<application>WebSpeed</application>' SKIP.
{&OUT} '<body>This is a simple text in an XML
tag</body>' SKIP.
{&OUT} '</xmldata>' SKIP.

/* end of testxml.p */

- The META HTTP-EQUIV tag in an HTML file with embedded
SpeedScript code:

For example:

<?xml version="1.0"?>
<META HTTP-EQUIV="Content-Type" CONTENT="text/xml">
<xmldata>
<application>WebSpeed</application>
<body>This is a simple text in an XML tag</body>
</xmldata>

Information on the use of the META tag in WebSpeed is
available in the WebSpeed Developer Guide, Section 5.10.2,
Specifying HTTP Header Information.

- Using the procedure output-headers to explicitly generate the
content-type from an HTML file with embedded SpeedScript code:

For example:

</?WS>
procedure output-headers:
output-content-type("text/xml").
end.
</?WS>
<?xml version="1.0"?>
<xmldata>
<application>WebSpeed</application>
<body>This is a simple text in an XML tag.</body>
</xmldata>