Re: [Moderator Action] Can you help me on XML problem?

Hello,

This is not the appropriate list for this type of question.
This list is for comments on the W3C home page and Web site.
For questions about "asp", I recommend you contact the
relevant developer.

  - Ian

Naowarat Seehapanya wrote:
> 
> I have some question on run at xml with asp:


> This is the asp code to run xml file: (test.asp). When i run this script 
> it only show loadstatus=false when i get the dtd from external file or 
> by url. I cannot found the result came from. Can you help me or tell me 
> what is my mistake on the script?.
> 
>  
> 
> <%
> nn_text="<?xml version=""1.0"" encoding=""UTF-8""?>"
> nn_text=nn_text &"<!DOCTYPE memo SYSTEM ""http://www.xxyy.com/test.dtd"">"
> nn_text=nn_text &"<memo>"
> nn_text=nn_text &"<to>Vee</to>"
> nn_text=nn_text &"<from>noon</from>"
> nn_text=nn_text &"<subject>Testing</subject>"
> nn_text=nn_text &"<body>Test Test Test</body>"
> nn_text=nn_text &"</memo>"
> 'Replace UTF-8 with UTF-16 so MSDOM Parser Doesn't Error  
> if instr(nn_text,"UTF-8") then
> Cxml_Text = Replace(nn_text, "UTF-8", "utf-16")
> end if
> 
> if instr(nn_text,"utf-8") then
> Cxml_Text= Replace(nn_text, "utf-8", "utf-16")   
> end if
> 
>  
> 
>  Set XDoc = Server.CreateObject("Microsoft.XMLDOM")
> ' Set XDoc = Server.CreateObject("MSXML2.DOMDOCUMENT") 
>  'Validate document when parsing
>  XDoc.ValidateOnParse = True
>  'Don't return parsing until done
>  XDoc.ASync = False
>  'Resolve external definitions while parsing
>  XDoc.ResolveExternals = True
>  'Check if parsing was succussfull
>  LoadStatus = XDoc.LoadXML(Cxml_Text)
> response.write "LoadStatus is  " & LoadStatus & "<br>"
> 
>  
> 
> response.write("<br>Error Code: ")
> response.write(XDoc.parseError.errorCode)
> response.write("<br>Error Reason: ")
> response.write(XDoc.parseError.reason)
> response.write("<br>Error Line: ")
> response.write(XDoc.parseError.line)
> %>
> 
>  
> 
> This is the dtd file: (test.dtd)
> 
>  
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!ELEMENT memo (to,from,subject,body)>
> <!ELEMENT to (#PCDATA)>
> <!ELEMENT from (#PCDATA)>
> <!ELEMENT subject (#PCDATA)>
> <!ELEMENT body (#PCDATA)>
> 
>  
> 
> Thanks & BestRegards,
> 
> Americus
> 
> 
> ------------------------------------------------------------------------
> Send and receive Hotmail on your mobile device: Click Here 
> <http://g.msn.com/1HM500901/156>



-- 
Ian Jacobs (ij@w3.org)   http://www.w3.org/People/Jacobs
Tel:                     +1 718 260-9447

Received on Tuesday, 25 June 2002 10:26:04 UTC