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.

java - how to find in xsd, whether the particular tag is available in xml or not? -


my xml file is,

 <?xml version="1.0"?>  <type xmlns:xs="http://www.w3.org/2001/xmlschema-instance"                                               xs:nonamespaceschemalocation="datatype.xsd">      <int>integer</int>     <varchar>varcharacter</varchar>     <double>doubles</double>     </type> 

in xml, want set <float></float> mandatory. didn't use tag. how validate <float> present or not in xml file, using xsd java.? in advance.

the following can used validate xml against schema:

import java.io.file;  import javax.xml.xmlconstants; import javax.xml.validation.schema; import javax.xml.validation.schemafactory; import javax.xml.validation.validator;  public class demo {      public static void main(string[] args) throws exception {         schemafactory sf = schemafactory.newinstance(xmlconstants.w3c_xml_schema_ns_uri);         schema schema = sf.newschema(new file("datatype.xsd"));          validator validator = schema.newvalidator();         validator.seterrorhandler(new myerrorhandler());         validator.validate(source);     }  } 

for more detailed example see:


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 -