@@ -72,11 +72,12 @@ public class XmlSchemaParser
7272 * Validate the document against a given schema. Error will be written to {@link java.lang.System#err} 
7373 * 
7474 * @param xsdFilename schema to validate against. 
75-  * @param in document to be validated. 
75+  * @param is source from which schema is read. Ideally it will have the systemId property set to resolve 
76+  * relative references. 
7677 * @param options to be applied during parsing. 
7778 * @throws Exception if an error occurs when parsing the document or schema. 
7879 */ 
79-  public  static  void  validate (final  String  xsdFilename , final  InputStream   in , final  ParserOptions  options )
80+  public  static  void  validate (final  String  xsdFilename , final  InputSource   is , final  ParserOptions  options )
8081 throws  Exception 
8182 {
8283 final  DocumentBuilderFactory  factory  = DocumentBuilderFactory .newInstance ();
@@ -91,15 +92,32 @@ public static void validate(final String xsdFilename, final InputStream in, fina
9192 factory .setFeature ("http://apache.org/xml/features/xinclude/fixup-base-uris" , false );
9293 }
9394
94-  factory .newDocumentBuilder ().parse (in );
95+  factory .newDocumentBuilder ().parse (is );
9596 }
9697
9798 /** 
98-  * Take an {@link InputSource} and parse it generating map of template ID to Message objects, types, and schema. 
99+  * Wraps the {@link InputStream} into an {@link InputSource} and delegates to 
100+  * {@link #validate(String, InputSource, ParserOptions)}. 
99101 * <p> 
100-  * Exceptions are passed back up for any problems. 
102+  * <b>Note:</b> this method does not set the {@link InputSource#setSystemId(java.lang.String)} property. 
103+  * However, it is recommended to use the {@link #validate(String, InputSource, ParserOptions)} method directly. 
101104 * 
102-  * @param is inputSource from which schema is read. Ideally it will have the systemId property set to resolve relative references 
105+  * @param xsdFilename schema to validate against. 
106+  * @param in document to be validated. 
107+  * @param options to be applied during parsing. 
108+  * @throws Exception if an error occurs when parsing the document or schema. 
109+  */ 
110+  public  static  void  validate (final  String  xsdFilename , final  InputStream  in , final  ParserOptions  options )
111+  throws  Exception 
112+  {
113+  validate (xsdFilename , new  InputSource (in ), options );
114+  }
115+ 
116+  /** 
117+  * Take an {@link InputSource} and parse it generating map of template ID to Message objects, types, and schema. 
118+  * 
119+  * @param is source from which schema is read. Ideally it will have the systemId property set to resolve 
120+  * relative references. 
103121 * @param options to be applied during parsing. 
104122 * @return {@link MessageSchema} encoding for the schema. 
105123 * @throws Exception on parsing error. 
@@ -135,13 +153,11 @@ public static MessageSchema parse(final InputSource is, final ParserOptions opti
135153 }
136154
137155 /** 
138-  * Wraps an {@link InputStream} into an {@link InputSource} and delegates to 
139-  * {@link #parse(org.xml.sax.InputSource, uk.co.real_logic.sbe.xml.ParserOptions) }. 
140-  * <p>Note: this method does not the the {@link InputSource#setSystemId(java.lang.String) } property, however. It is recommended to use the 
141-  * {@link #parse(org.xml.sax.InputSource, uk.co.real_logic.sbe.xml.ParserOptions) } method directly.</p> 
142-  * 
156+  * Wraps the {@link InputStream} into an {@link InputSource} and delegates to 
157+  * {@link #parse(InputSource, ParserOptions)}. 
143158 * <p> 
144-  * Exceptions are passed back up for any problems. 
159+  * <b>Note:</b> this method does not set the {@link InputSource#setSystemId(java.lang.String)} property. 
160+  * However, it is recommended to use the {@link #parse(InputSource, ParserOptions)} method directly. 
145161 * 
146162 * @param in stream from which schema is read. 
147163 * @param options to be applied during parsing. 
0 commit comments