From ffb10c360b79cbd80afff7c29e11c814c6042a1b Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Sun, 10 Nov 2013 13:48:37 +0100 Subject: [PATCH] doc --- src/site/markdown/example-xsd.md.vm | 39 ++++++++++++++++++----------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/src/site/markdown/example-xsd.md.vm b/src/site/markdown/example-xsd.md.vm index fea3d1f1..8801d549 100644 --- a/src/site/markdown/example-xsd.md.vm +++ b/src/site/markdown/example-xsd.md.vm @@ -8,20 +8,29 @@ interface. It works with your default DOM implementation. For example: ```java -String xsd = "", - + "", - + ""; -Collection errors = new XSDDocument(xsd).validate( - new StreamSource( - IOUtils.toInputStream( - "Coffee to go", - "UTF-8" - ) - ) -); -if (errors.isEmpty()) { - System.out.println("XML is valid"); -} else { - System.out.println("XSD validation failed: " + errors); +import com.jcabi.xml.XSDDocument; +import java.util.Collection; +import javax.xml.transform.stream.StreamSource; +import org.apache.commons.io.IOUtils; +import org.xml.sax.SAXParseException; +public class Main { + public void main(String[] args) { + String xsd = "", + + "", + + ""; + Collection errors = new XSDDocument(xsd).validate( + new StreamSource( + IOUtils.toInputStream( + "Coffee to go", + "UTF-8" + ) + ) + ); + if (errors.isEmpty()) { + System.out.println("XML is valid"); + } else { + System.out.println("XSD validation failed: " + errors); + } + } } ```