Trait

com.github.eerohele.expek

ValidatingXsltSpecification

Related Doc: package expek

Permalink

trait ValidatingXsltSpecification extends XsltSpecification with SchemaValidationMatchers

An XsltSpecification that validates the result against outputSchema without having to explicitly add beValid to every test.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ValidatingXsltSpecification
  2. SchemaValidationMatchers
  3. XsltSpecification
  4. XsltSupport
  5. XPathSupport
  6. XsltResultMatchers
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class withFiles(mockFiles: (FileSystem) ⇒ MockFile*) extends BeforeAfter with Product with Serializable

    Permalink

    Given a list of functions that take a Jimfs instance and return a MockFile, create the mockfiles in the given file system and delete them after running the specification.

    Given a list of functions that take a Jimfs instance and return a MockFile, create the mockfiles in the given file system and delete them after running the specification.

    The mock files are then available for parsing during the test. Any relative URIs and URIs that use Jimfs.URI_SCHEME as the scheme will be resolved against the given Jimfs file system.

    Definition Classes
    XsltSpecification

Abstract Value Members

  1. implicit abstract val outputSchema: Builder

    Permalink
  2. abstract val stylesheet: Source

    Permalink

    The stylesheet you want to test.

    The stylesheet you want to test.

    Definition Classes
    XsltSpecification

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object XPath

    Permalink
    Definition Classes
    XPathSupport
  5. object XSLT

    Permalink

    Functions for converting an XSLT stylesheet into a Source.

    Functions for converting an XSLT stylesheet into a Source.

    Definition Classes
    XsltSupport
  6. def applying(query: String)(input: ⇒ Node): TemplateApplication

    Permalink

    Apply the XSLT template for the node selected by the given XPath query, using the input Node as the context node.

    Apply the XSLT template for the node selected by the given XPath query, using the input Node as the context node.

    Equivalent to <xsl:apply-templates/>.

    Definition Classes
    XsltSpecification
  7. def applying(input: ⇒ Node): TemplateApplication

    Permalink

    Apply the XSLT template for the given Node in the stylesheet defined in this specification.

    Apply the XSLT template for the given Node in the stylesheet defined in this specification.

    Equivalent to <xsl:apply-templates/>.

    Definition Classes
    XsltSpecification
  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def asMap(tuple: (String, Any)*): Map[QName, XdmValue]

    Permalink

    Convert a sequence of tuples into a Map of parameters that Saxon understands.

    Convert a sequence of tuples into a Map of parameters that Saxon understands.

    Definition Classes
    XsltSpecification
  10. def attribute(a: (String, String)): XdmNode

    Permalink

    Create an XdmNode attribute() node.

    Create an XdmNode attribute() node.

    If your template or function expects an attribute, use this function.

    Definition Classes
    XsltSpecification
  11. def beMatching(query: String): XPathResultMatcher[Transformation]

    Permalink

    A specs2 matcher that tests whether a node matches an XPath expression.

    A specs2 matcher that tests whether a node matches an XPath expression.

    Example:

    applying { <foo>x</foo> } must beMatching("bar[. eq 'x']")
    Definition Classes
    XsltSpecification
  12. def beValid(implicit outputSchema: Builder): SchemaValidationMatcher[Transformation]

    Permalink

    Validate the transformation result against the XML Schema in the implicit scope.

    Validate the transformation result against the XML Schema in the implicit scope.

    Definition Classes
    SchemaValidationMatchers
  13. def beValidAgainst(schema: Builder): SchemaValidationMatcher[Transformation]

    Permalink

    Validate the transformation result against the given XML Schema.

    Validate the transformation result against the given XML Schema.

    Definition Classes
    SchemaValidationMatchers
  14. final val builder: DocumentBuilder

    Permalink

    A Saxon DocumentBuilder instance for converting DOM nodes into XML Data Model (XDM) instances

    A Saxon DocumentBuilder instance for converting DOM nodes into XML Data Model (XDM) instances

    Definition Classes
    XsltSpecificationXPathSupport
  15. def callingFunction(lexical: String)(parameters: Any*)(implicit namespace: String): FunctionCall

    Permalink

    Call an XSLT function, using the namespace URI defined implicitly in the XsltSpecification instance.

    Call an XSLT function, using the namespace URI defined implicitly in the XsltSpecification instance.

    Definition Classes
    XsltSpecification
  16. def callingFunction(uri: String, lexical: String)(parameters: Any*): FunctionCall

    Permalink

    Call an XSLT function with the given parameters.

    Call an XSLT function with the given parameters.

    Definition Classes
    XsltSpecification
  17. def callingTemplate(name: String, contextNode: Node): TemplateCall

    Permalink

    Call a named XSLT template and supply a context node (as Node) for the transformation.

    Call a named XSLT template and supply a context node (as Node) for the transformation.

    Definition Classes
    XsltSpecification
  18. def callingTemplate(name: String, contextNode: XdmNode): TemplateCall

    Permalink

    Call a named XSLT template and supply a context node (as XdmNode) for the transformation.

    Call a named XSLT template and supply a context node (as XdmNode) for the transformation.

    Definition Classes
    XsltSpecification
  19. def callingTemplate(name: String): TemplateCall

    Permalink

    Call a named XSLT template

    Call a named XSLT template

    Definition Classes
    XsltSpecification
  20. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final val configuration: Configuration

    Permalink

    An extensible Saxon Configuration instance.

    An extensible Saxon Configuration instance.

    Overriding is prevented to make it more difficult to accidentally lose the support for reading from and writing to an in-memory Jimfs file system.

    Definition Classes
    XsltSpecification
  22. def convert(value: Any): Any

    Permalink
    Attributes
    protected
    Definition Classes
    XsltResultMatchers
  23. val defaultMatcher: (Source) ⇒ CompareMatcher

    Permalink

    The default matcher for comparing two XML element or document nodes.

    The default matcher for comparing two XML element or document nodes.

    Definition Classes
    XsltSpecification
  24. def documentNode(node: Node): XdmNode

    Permalink

    Convert an Elem into an XdmNode document-node() node.

    Convert an Elem into an XdmNode document-node() node.

    Definition Classes
    XsltSpecification
  25. def element(node: Node): XdmNode

    Permalink

    Convert an Elem into an XdmNode element() node.

    Convert an Elem into an XdmNode element() node.

    By default, any Elem instance you create and give as a parameter is a document node. If your template or function expects an element, use this function.

    Definition Classes
    XsltSpecification
  26. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  27. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  28. lazy val fileSystem: FileSystem

    Permalink

    The in-memory file system that stores MockFile instances and documents generated with <xsl:result-document>.

    The in-memory file system that stores MockFile instances and documents generated with <xsl:result-document>.

    Every specification uses its own in-memory file system. If you need every test to have its own in-memory file system, use the specs2 isolation argument.

    Note, however, that if you enable isolation, the stylesheet will currently also be compiled per-test rather than per-specification, because the file system needs to be instantiated before the stylesheet is compiled.

    Definition Classes
    XsltSpecification
  29. def filterAttr(f: (Attr) ⇒ Boolean): (Source) ⇒ CompareMatcher

    Permalink

    Create a function that takes a Source and returns a CompareMatcher that filters attributes according to the given predicate.

    Create a function that takes a Source and returns a CompareMatcher that filters attributes according to the given predicate.

    For filtering elements and other node types, use filterNode.

    Example:

    // Apply templates for x, ignore differences in the @id attribute.
    applying(<x/>) must produce(<y/>)(filterAttr(!XPath.matches("@id", _))
    Definition Classes
    XsltSpecification
  30. def filterNode(f: (Node) ⇒ Boolean): (Source) ⇒ CompareMatcher

    Permalink

    Create a function that takes a Source and returns a CompareMatcher that filters nodes according to the given predicate.

    Create a function that takes a Source and returns a CompareMatcher that filters nodes according to the given predicate.

    For filtering attributes, use filterAttr.

    Example:

    // Apply templates for a, ignore differences in the d children of c.
    applying(<a><b/></a>) must produce(<c/>)(filterNode(!XPath.matches("c/d", _))
    Definition Classes
    XsltSpecification
  31. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  32. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  33. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  34. val inputSchema: Option[Builder]

    Permalink

    The XML Schema to use for validating the input XML and loading default attributes

    The XML Schema to use for validating the input XML and loading default attributes

    Example:

    import org.xmlunit.builder.Input
    
    override val inputSchema = Some(Input.fromFile("schema.xsd"))
    Definition Classes
    XsltSpecification
  35. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  36. implicit def matcher: (Source) ⇒ CompareMatcher

    Permalink

    A function that takes a Source and returns a CompareMatcher that compares the given Source to an XML fragment.

    A function that takes a Source and returns a CompareMatcher that compares the given Source to an XML fragment.

    You can extend the default matcher by by overriding it in your specification:

    class MySpecification extends mutable.Specification with XsltSpecification {
        ...
    
        // A matcher that ignores @id attributes when comparing elements.
        override implicit def matcher = (s: Source) => defaultMatcher(s).withAttributeFilter(
            filter[Attr](a => a.getName != "id")
        )
    
        ...
    }

    You can also use a different matcher for a single test:

    "Ignore an attribute" in {
        // Define a custom matcher for this test only.
        val m = (s: Source) => defaultMatcher(s).withAttributeFilter(
        // Ignore any attribute called "ignore-me".
            filter[Attr](a => a.getName != "ignore-me")
        )
    
        // Pass in the custom matcher.
        applying(<x/>) must produce(<y/>)(m)
    }
    Definition Classes
    XsltSpecification
  37. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  38. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  39. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  40. val parameters: Map[QName, XdmValue]

    Permalink

    Global stylesheet parameters.

    Global stylesheet parameters.

    You can either supply a Map[QName, XdmValue] or call asMap on a sequence of tuples:

    scala> asMap("string" -> "foo", "int" -> 1, "uri" -> new URI("http://www.google.com"))
    res2: Map[QName, XdmItem] = Map(string -> foo, int -> 1, uri -> http://www.google.com)
    Definition Classes
    XsltSpecification
  41. def pi(pi: ProcInstr): XdmNode

    Permalink

    Convert a ProcInstr into an XdmNode processing-instruction() node.

    Convert a ProcInstr into an XdmNode processing-instruction() node.

    Definition Classes
    XsltSpecification
  42. final val processor: Processor

    Permalink

    The Saxon Processor to use for running the stylesheet.

    The Saxon Processor to use for running the stylesheet.

    By default, it is configured to use the in-memory file system and an XML parser that can use XML catalogs.

    Definition Classes
    XsltSpecification
  43. def produce(result: ⇒ Vector[Any])(implicit matcher: (Source) ⇒ CompareMatcher): Matcher[Transformation]

    Permalink

    Create a matcher that compares the supplied arguments against the result of an XML transformation.

    Create a matcher that compares the supplied arguments against the result of an XML transformation.

    Example use:

    class MySpecification extends mutable.Specification with XsltSpecification {
        val stylesheet = XSLT.file("my-stylesheet.xsl")
    
        "Convert a into b" in {
            // Apply the templates for the  element in the XSLT stylesheet and check the result.
            applying { <a>foo</a> } must produce { <b>foo</b> }
        }
    }
    Definition Classes
    ValidatingXsltSpecificationXsltResultMatchers
  44. def produce(any: Any*)(implicit matcher: (Source) ⇒ CompareMatcher): Matcher[Transformation]

    Permalink
    Definition Classes
    XsltResultMatchers
  45. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  46. def text(data: String): XdmNode

    Permalink

    Convert a String into an XdmNode text() node.

    Convert a String into an XdmNode text() node.

    If you have a function that expects a text node parameter, call this method with a string argument to create a text node, then pass it to your function.

    Definition Classes
    XsltSpecification
  47. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  48. def transformer: Xslt30Transformer

    Permalink

    Get a new Xslt30Transformer instance for the compiled stylesheet.

    Get a new Xslt30Transformer instance for the compiled stylesheet.

    Any global parameters you set are set when this method is called.

    Definition Classes
    XsltSpecification
  49. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  52. lazy val xpathCompiler: XPathCompiler

    Permalink
    Definition Classes
    XsltSpecificationXPathSupport
  53. lazy val xsltCompiler: XsltCompiler

    Permalink
    Definition Classes
    XsltSpecificationXsltSupport

Inherited from SchemaValidationMatchers

Inherited from XsltSpecification

Inherited from XsltSupport

Inherited from XPathSupport

Inherited from XsltResultMatchers

Inherited from AnyRef

Inherited from Any

Ungrouped