我正在尝试使用response.write()语句呈现xml元素,如下所示。但是它正在呈现为嵌套元素。
Response.Write("<MessageList><message name=\"ButtonNone\" value=\"[None]\"/><message name=\"ButtonCancel\" value=\"Cancel\" desc=\"Close this screen without saving changes you have made.\" width=\"200\" height=\"60\"/><message name=\"Platform_MemberId\" value=\"Member ID\" width=\"300\" height=\"100\"/><message name=\"Platform_UserMemberId\" value=\"User Member ID\"/><message name=\"Platform_Password\" value=\"Password\" width=\"300\" height=\"100\"/><message name=\"Platform_ClientPassword\" value=\"Client Password\"/><message name=\"Platform_ForgetLogin\" value=\"Forgot your ID or password?\" width=\"300\" height=\"100\"/><message name=\"Platform_Login\" value=\"Continue\" width=\"300\" height=\"100\"/><message name=\"Platform_WFGPageFirst\" value=\"First <<__arg1__>>\" desc=\"Display the first section of the list.\" width=\"200\" height=\"50\"/><message name=\"Platform_WFGPagePrev\" value=\"Previous <<__arg1__>>\" desc=\"Display the previous section of the list.\" width=\"200\" height=\"50\"/><message name=\"Platform_WFGPageNext\" value=\"Next <<__arg1__>>\" desc=\"Display the next section of the list.\" width=\"200\" height=\"50\"/><message name=\"CommonLabelOrgUnit\" value=\"Org Unit\" desc=\"Depending on your assigned security role, you may or may not be able to select all organizational units. If you do not have access to a specific organizational unit, but need access, please contact your system administrator.\" width=\"300\" height=\"105\"/><message name=\"CommonLabelRole\" value=\"Role\"/><message name=\"ButtonContinue\" value=\"Continue\" desc=\"Once the required information has been entered, click this button to go to the next step in the process.\" width=\"300\" height=\"60\"/><message name=\"prtAlertCannotLogin\" value=\"You are already logged in. You cannot log in twice from the same browser. To log in again, close and restart your browser.\" width=\"300\" height=\"100\"/><message name=\"prtAlertLoginSelectOrg\" value=\"You must select a default organizational unit.\" width=\"300\" height=\"100\"/><message name=\"prtAlertLoginSelectRole\" value=\"You must select a default role.\" width=\"300\" height=\"100\"/><message name=\"prtAlertLoginInvSel\" value=\"Invalid selections, please continue...\" width=\"300\" height=\"100\"/><message name=\"prtAlertLoginUsername\" value=\"You must specify a username.\" width=\"300\" height=\"100\"/><message name=\"prtAlertLoginPassword\" value=\"You must specify a password.\" width=\"300\" height=\"100\"/><message name=\"prtAlertLoginUnsuccess\" value=\"Your logon was not successful. Please check your Member ID and Password, then re-enter them here to log in.\r\n\r\nNote: your Password is case sensitive. Be sure to enter each letter as it was entered when you opened the account, paying special attention to whether each letter is upper-case or lower-case.\" width=\"300\" height=\"100\"/><message name=\"prtAlertLoginUnsuccessSh\" value=\"Your logon was not successful. Please check the Member ID and Password.\" width=\"300\" height=\"100\"/><message name=\"prtAlertTimeout\" value=\"Your session has expired or you have not logged in. \r\n\r\nPlease enter your Member ID and Password here to log in.\" width=\"300\" height=\"100\"/><message name=\"prtAlertChangePassword\" value=\"Please change your password.\" width=\"300\" height=\"100\"/><message name=\"prtAlertLoginBlockout\" value=\"You have exceeded the number of allowed login attempts. Please try again later.\" width=\"300\" height=\"100\"/><message name=\"prtAlertLoginCancel\" value=\"Are you sure you want to cancel?\" width=\"300\" height=\"100\"/><message name=\"Platform_NoMatches\" value=\"[No Matches]\" width=\"300\" height=\"100\"/><message name=\"prtNoteInstorePC\" value=\"Note: You are logging in from an in-store PC.\" width=\"300\" height=\"100\"/><message name=\"prtAlertLoginBUNotAllowed\" value=\"This PC has been registered for use in this business unit only. You cannot log in from this PC because you do not have rights to work at this business unit.\" width=\"300\" height=\"100\"/><message name=\"prtAlertLoginRoleNotAllowed\" value=\"Your assigned role(s) cannot be accessed from this remote location. You cannot log in from this PC.\" width=\"300\" height=\"100\"/><message name=\"prtAlertLoginRoleNotAllowedThisOrg\" value=\"There is no message named 'prtAlertLoginRoleNotAllowedThisOrg'.\"/><message name=\"prtSaveDefault\" value=\"Remember selections\" width=\"300\" height=\"100\"/><message name=\"prtLanguageLogin\" value=\"Language\" desc=\"Select the language to use for this session\" width=\"300\" height=\"100\"/><message name=\"ptFrmInvalidUserRole\" value=\"The Role selected is not an authorized User Role that is assigned to the logged in user.\" width=\"300\" height=\"100\"/></MessageList>");
实际:
<MessageList>
<message name="ButtonNone" value="[None]"/>
<message name="ButtonCancel" value="Cancel" desc="Close this screen without
saving changes you have made." width="200" height="60"/>
<message name="Platform_MemberId" value="Member ID" width="300"
height="100"/>
..
..
</MessageList>
在IE11和chrome上渲染后
<messagelist>
<message name="ButtonNone" value="[None]">
<message height="60" width="200" name="ButtonCancel" value="Cancel"
desc="Close this screen without saving changes you have made.">
..
..
</message>
</message>
</messagelist>
如果我将响应内容类型设置为XML,则它显示为xml,但显示正确。但我希望将其呈现为HTML文档。
注意::这完全适用于IE5。这实际上是XML Island的一部分,但是由于IE 9+没有支持,因此我正在寻找使其在新浏览器上运行的可能性。
有人能指出我要解决的正确方向吗?任何帮助将不胜感激。