Class CsdlParser

java.lang.Object
io.skipcheck.tm1.csdl.CsdlParser

public final class CsdlParser extends Object
Parses CSDL XML ($metadata) into a CsdlDocument.

The parser is hardened for documents from servers you may not control: DOCTYPE declarations are refused, so external entities and entity expansion can't apply. It's lenient about content instead. Unknown elements, attributes and annotation terms are ignored or kept as data, as the CSDL specification asks of clients.

  • Field Details

  • Method Details

    • parse

      public static CsdlDocument parse(String xml)
      Parses a CSDL document from text.
      Parameters:
      xml - the document's XML
      Returns:
      the parsed document
      Throws:
      CsdlParseException - if it isn't well-formed XML, or not a CSDL document
    • parse

      public static CsdlDocument parse(InputStream xml)
      Parses a CSDL document. The stream isn't closed.
      Parameters:
      xml - the document's XML, read to the end
      Returns:
      the parsed document
      Throws:
      CsdlParseException - if it isn't well-formed XML, or not a CSDL document