org.apache.shindig.social.opensocial.util
Class XSDValidator

java.lang.Object
  extended by org.apache.shindig.social.opensocial.util.XSDValidator

public class XSDValidator
extends java.lang.Object

Validator utility for testing.


Field Summary
static java.lang.String XMLDEC
          The XML declaration
 
Constructor Summary
XSDValidator()
           
 
Method Summary
static java.lang.String insertSchema(java.lang.String xml, java.lang.String schemaStatement, boolean removeContainer)
          Process the response string to strip the container element and insert the opensocial schema.
static java.lang.String validate(java.io.InputStream xml, java.io.InputStream schema)
          Validate a xml input stream against a supplied schema.
static java.lang.String validate(java.lang.String xml, java.io.InputStream schema)
          Validate a xml string against a supplied schema.
static java.lang.String validate(java.lang.String xmlFragment, java.lang.String schemaStatement, java.lang.String schemaResource, boolean removeContainer)
           
static java.lang.String validateOpenSocial(java.lang.String xmlFragment)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XMLDEC

public static final java.lang.String XMLDEC
The XML declaration

See Also:
Constant Field Values
Constructor Detail

XSDValidator

public XSDValidator()
Method Detail

validate

public static java.lang.String validate(java.lang.String xml,
                                        java.io.InputStream schema)
Validate a xml string against a supplied schema.

Parameters:
xml - the xml presented as a string
schema - an input stream containing the xsd
Returns:
a list of errors or a 0 lenght string if none.

validate

public static java.lang.String validate(java.io.InputStream xml,
                                        java.io.InputStream schema)
Validate a xml input stream against a supplied schema.

Parameters:
xml - a stream containing the xml
schema - a stream containing the schema
Returns:
a list of errors or warnings, a 0 lenght string if none.

insertSchema

public static java.lang.String insertSchema(java.lang.String xml,
                                            java.lang.String schemaStatement,
                                            boolean removeContainer)
Process the response string to strip the container element and insert the opensocial schema.

Parameters:
xml -
Returns:

validate

public static java.lang.String validate(java.lang.String xmlFragment,
                                        java.lang.String schemaStatement,
                                        java.lang.String schemaResource,
                                        boolean removeContainer)
Parameters:
xmlFragment -
Returns:
a list of errors

validateOpenSocial

public static java.lang.String validateOpenSocial(java.lang.String xmlFragment)


Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.