<cfparam name="FORM.XmlText"
		  default="<Name xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
		    		xsi:noNamespaceSchemaLocation=''>
				   <FirstName>George</FirstName>
				   <LastName>Washington</LastName>
				   </Name>">
  <html>
  <head>
  <title>XmlValidate()</title>
  </head>
  <body>
  <h1>XML Validation Test</h1>
  <cfoutput>
  <form method="post" action="#CGI.SCRIPT_NAME#">
  <textarea name="XmlText" cols="60" rows="10">#FORM.XmlText#</textarea>
  <br>
<input name="SubmitButton" type="submit" value="Validate XML">
  <cfif isDefined("FORM.SubmitButton")>
   <cfset structResults = XmlValidate(FORM.XmlText,ExpandPath("Name.xsd"))>
   <cfif structResults.status>
    <span style="margin-left:200px;color:green">XML is valid.</span>
   <cfelse>
    <span style="margin-left:200px;color:red">XML is not valid.</span>
    <div style="margin-top:10px">
    <cfif ArrayLen(structResults.Errors)>
     <b>Errors:</b>
     <ol style="margin-top:0px">
      <cfloop index="i" from="1" to="#ArrayLen(structResults.Errors)#">
       <li>#structResults.errors[i]#</li>
      </cfloop>
     </ol>
    </cfif> 
   <cfif ArrayLen(structResults.FatalErrors)>
     <b>Fatal Errors:</b>
     <ol style="margin-top:0px">
      <cfloop index="i" from="1" to="#ArrayLen(structResults.FatalErrors)#">
       <li>#structResults.fatalErrors[i]#</li>
      </cfloop>
     </ol>
    </cfif>
    <cfif ArrayLen(structResults.Warnings)>
     <b>Warnings:</b>
     <ol style="margin-top:0px">
      <cfloop index="i" from="1" to="#ArrayLen(structResults.Warnings)#">
       <li>#structResults.warnings[i]#</li>
      </cfloop>
     </ol>
    </cfif>
    </div>
   </cfif>
  </cfif>
  </form>
  </cfoutput>
  </body> 
 </html>