[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Cannot have a DOCTYPE declaration outside of a prolog

Subject: Cannot have a DOCTYPE declaration outside of a prolog
From: mad rat <mad_rat_on_run@xxxxxxxxx>
Date: Wed, 27 Apr 2005 20:39:18 -0700 (PDT)
cannot have a doctype declaration
=======================================================
The XML page cannot be displayed 
Cannot view XML input using XSL style sheet. Please
correct the error and then click the Refresh button,
or try again later. 


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

Cannot have a DOCTYPE declaration outside of a prolog.
Error processing resource
'http://localhost:28178/omniparkv3/search....

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
----------^
=======================================================


I am getting the above error while trying to return
XML data via Response.Write as follows : 

=======================================================
                HttpContext current;
                current = HttpContext.Current;
                current.Response.ContentType =
"text/xml";                
                current.Response.ContentEncoding = new
System.Text.UTF8Encoding();
                current.Response.ClearContent();

                StringBuilder xml = new
StringBuilder();
                xml.Append("<?xml version=" + "\"" +
"1.0" + "\"" + "?>\r\n");
                xml.Append("<?xml-stylesheet
type=\"text/xsl\"
href=\"http://localhost/transform.xsl\"?>");
                xml.Append("");
                xml.Append("<!-- Title -->\r\n");
                xml.Append("<T1>\r\n");
                xml.Append("<Message>Some
text</Message>\r\n");
                xml.Append("</T1>\r");
               
current.Response.Write(xml.ToString());
=======================================================

Someone answered in a similar discussion in the
archives that following worked : 

<xsl:output doctype-public="-//W3C//DTD HTML 4.01//EN"
doctype-system="http://www.w3.org/TR/html4/strict.dtd"
method="html" version="4.01" encoding="UTF-8"
indent="yes"/>

I placed following file at
http://localhost/transform.xsl in the xml data I
returned as written above : 

=======================================================
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">

<xsl:output doctype-public="-//W3C//DTD HTML 4.01//EN"
doctype-system="http://www.w3.org/TR/html4/strict.dtd"
method="html" version="4.01" encoding="UTF-8"
indent="yes"/>

</xsl:stylesheet>
=======================================================

Even after this I am still getting the same error
although IE does appear to apply this xsl file since
it  says 'this page is accessing information that is
not under its control .....'

Any help would be appreciated.

Thanks.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.