Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

xml validation - why did not got any error while validating my xml? -


my xml not getting correctly validated against xsd. expect browser through atleast kind of generic error messages when open xml file

my xml file below note.xml

    <?xml version="1.0"?>     <note     xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"     xsi:schemalocation="note.xsd">       <from>jani</from>       <heading>reminder</heading>       <body>don't forget me weekend!</body>       </note> 

my xsd file below note.xsd

      <?xml version="1.0"?>       <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema"        targetnamespace="http://www.w3schools.com"        xmlns="http://www.w3schools.com"          elementformdefault="qualified"><xs:element name="note">         <xs:complextype>          <xs:sequence>          <xs:element name="from" type="xs:string"/>          <xs:element name="heading" type="xs:string"/>          <xs:element name="body" type="xs:string"/>          </xs:sequence>         <xs:attribute name="to" type="xs:string" use="required"/>          </xs:complextype>           </xs:element></xs:schema> 

both note.xml , note.xsd files in same folder. can guide why not getting error? can me how validate xml file xsd? thank you,

three problems:

  1. xsi:schemalocation attribute value should white-space separate sequence of namespace uri , schema document uri, xsi:schemalocation="http://www.w3schools.com note.xsd"
  2. you wrote:

    i expect browser through atleast kind of generic error

    it's not clear using validation tool. no browser validates xml schema when open xml document.

  3. your schema targets http://www.w3schools.com namespace uri, document under null (or empty) namespace uri. end in validation error, if use xsi:nonamespaceschemalocation instead of xsi:schemalocation attribute. maybe want add default namespace declaration in input source xmlns="http://www.w3schools.com"...

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -