Class DaliExampleReader

java.lang.Object
uk.ac.starlink.vo.DaliExampleReader

public class DaliExampleReader extends Object
Extracts DaliExample objects from a document. The document is probably XHTML with RDFa markup.

Instances of this class are not thread-safe.

Since:
12 May 2015
Author:
Mark Taylor
See Also:
  • Constructor Details

    • DaliExampleReader

      public DaliExampleReader()
      Constructor.
  • Method Details

    • readExamples

      public List<Tree<DaliExample>> readExamples(URL url) throws IOException
      Reads a list of examples from a document at a given URL. The result may be a hierarchical tree if continuation nodes are present in the document.

      Any fragment identifier on the URL is ignored.

      Parameters:
      url - location of examples document
      Returns:
      list of examples
      Throws:
      IOException
    • createExample

      public DaliExample createExample(Element exEl, URL docUrl) throws IOException
      Creates an example from a given DOM element.
      Parameters:
      exEl - element node with DALI RDFa example content
      docUrl - base URL of host document
      Returns:
      example object
      Throws:
      IOException
    • main

      public static void main(String[] args) throws IOException
      Reports basic information about the examples in a document at a URL supplied on the command line.
      Throws:
      IOException