|
[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
======================================================= 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Cast Your Vote
We need your help – Vote for DataDirect XML Products!
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! Subscribe in XML format
|







