/** * Validates a xml document * @param xmlString the string with the xml to validate * @return if the document is valid returns true */ public static PsiValidatorReport validate( String xmlString ) { InputSource inputSource = new InputSource( new StringReader( xmlString ) ); return validate( inputSource ); }
/** * Validates a xml document * @param file the file with the xml to validate * @return if the document is valid returns true */ public static PsiValidatorReport validate( File file ) throws FileNotFoundException { String filename = file.getAbsolutePath(); log.debug( "Validating " + filename ); InputSource inputSource = new InputSource( new FileReader( filename ) ); return validate( inputSource ); }
/** * Validates a xml document * @param xmlString the string with the xml to validate * @return if the document is valid returns true */ public static PsiValidatorReport validate( String xmlString ) { InputSource inputSource = new InputSource( new StringReader( xmlString ) ); return validate( inputSource ); }
/** * Validates a xml document * @param xmlString the string with the xml to validate * @return if the document is valid returns true */ public static PsiValidatorReport validate( String xmlString ) { InputSource inputSource = new InputSource( new StringReader( xmlString ) ); return validate( inputSource ); }
/** * Validates a xml document * @param file the file with the xml to validate * @return if the document is valid returns true */ public static PsiValidatorReport validate( File file ) throws FileNotFoundException { String filename = file.getAbsolutePath(); log.debug( "Validating " + filename ); InputSource inputSource = new InputSource( new FileReader( filename ) ); return validate( inputSource ); }
/** * Validates a xml document * @param file the file with the xml to validate * @return if the document is valid returns true */ public static PsiValidatorReport validate( File file ) throws FileNotFoundException { String filename = file.getAbsolutePath(); log.debug( "Validating " + filename ); InputSource inputSource = new InputSource( new FileReader( filename ) ); return validate( inputSource ); }
private static PsiValidatorReport writeFile(Document doc, File xmlFile, boolean validate) throws IOException { // create the parent dir if it does not exist if (!xmlFile.getParentFile().exists()) { log.info("Creating dir: "+xmlFile.getParentFile()); xmlFile.getParentFile().mkdirs(); } Writer writer = new FileWriter(xmlFile); DisplayXML.write(doc, writer, " "); writer.close(); if (validate) { return PsiValidator.validate(xmlFile); } return new PsiValidatorReport(); }
private static PsiValidatorReport writeFile(Document doc, File xmlFile, boolean validate) throws IOException { // create the parent dir if it does not exist if (!xmlFile.getParentFile().exists()) { log.info("Creating dir: "+xmlFile.getParentFile()); xmlFile.getParentFile().mkdirs(); } Writer writer = new FileWriter(xmlFile); DisplayXML.write(doc, writer, " "); writer.close(); if (validate) { return PsiValidator.validate(xmlFile); } return new PsiValidatorReport(); }
private static PsiValidatorReport writeFile(Document doc, File xmlFile, boolean validate) throws IOException { // create the parent dir if it does not exist if (!xmlFile.getParentFile().exists()) { log.info("Creating dir: "+xmlFile.getParentFile()); xmlFile.getParentFile().mkdirs(); } Writer writer = new FileWriter(xmlFile); DisplayXML.write(doc, writer, " "); writer.close(); if (validate) { return PsiValidator.validate(xmlFile); } return new PsiValidatorReport(); }
PsiValidator.validate( file );
PsiValidator.validate( file );
PsiValidator.validate( file );