| 1 |
package com.thaiopensource.validation; |
| 2 |
|
| 3 |
import org.xml.sax.SAXException; |
| 4 |
|
| 5 |
import javax.xml.transform.stream.StreamSource; |
| 6 |
import javax.xml.validation.Validator; |
| 7 |
import java.io.File; |
| 8 |
import java.io.IOException; |
| 9 |
import java.net.URL; |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
abstract public class Validator2 extends Validator { |
| 15 |
protected Validator2() { } |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
public void validate(File file) throws SAXException, IOException { |
| 22 |
validate(new StreamSource(file)); |
| 23 |
} |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
public void validate(URL url) throws SAXException, IOException { |
| 30 |
validate(new StreamSource(url.toExternalForm())); |
| 31 |
} |
| 32 |
} |