DocumentBuilder<'TSource> (Fornax.Seo)1.6.0 Fornax.Seo

DocumentBuilder<'TSource> Type

Transforms (X/HT)ML markup text into XML documents or fragments

Record fields

Record Field Description

ReaderSettings

Full Usage: ReaderSettings

Field type: XmlReaderSettings

The settings used to parse incoming markup text

Field type: XmlReaderSettings

Root

Full Usage: Root

Field type: XmlDocument

The underlying XML document object of this DocumentBuilder

Field type: XmlDocument

WriterSettings

Full Usage: WriterSettings

Field type: XmlWriterSettings

The settings used by the underlying document object to create XML

Field type: XmlWriterSettings

Constructors

Constructor Description

DocumentBuilder(schema, ?eventHandler, ?writeXmlDecl, ?writeBom, ?minify)

Full Usage: DocumentBuilder(schema, ?eventHandler, ?writeXmlDecl, ?writeBom, ?minify)

Parameters:
    schema : XmlSchema - The XML schema used to validate source markup text. No validation is performed if this argument is null
    ?eventHandler : ValidationEventHandler - An optional handler for schema validation errors
    ?writeXmlDecl : bool - true to include the <?xml ...?> declaration in generated documents (omitted if the source markup is a document fragment). The default is true
    ?writeBom : bool - true to include a Unicode byte order mark in generated document text. The default is false
    ?minify : bool - true to remove indentation and whitespace from the generated document or fragment, not including text in the scope of the xml:space="preserve" attribute. The default is false

Returns: DocumentBuilder<'TSource>

Creates a new DocumentBuilder with the given XML schema, optional validation event handler, and output format options

schema : XmlSchema

The XML schema used to validate source markup text. No validation is performed if this argument is null

?eventHandler : ValidationEventHandler

An optional handler for schema validation errors

?writeXmlDecl : bool

true to include the <?xml ...?> declaration in generated documents (omitted if the source markup is a document fragment). The default is true

?writeBom : bool

true to include a Unicode byte order mark in generated document text. The default is false

?minify : bool

true to remove indentation and whitespace from the generated document or fragment, not including text in the scope of the xml:space="preserve" attribute. The default is false

Returns: DocumentBuilder<'TSource>

DocumentBuilder()

Full Usage: DocumentBuilder()

Returns: DocumentBuilder<'TSource>

Creates a new DocumentBuilder

Returns: DocumentBuilder<'TSource>

Instance members

Instance member Description

this.AsMarkup

Full Usage: this.AsMarkup

Parameters:
    instance : 'TSource

Returns: string
Modifiers: abstract

When overridden by a derived class, returns a string of (X/HT)ML markup representing the given instance

instance : 'TSource
Returns: string
Example

   open Fornax.Seo.Xml

   type MarkupSource() =
       class
       end

   let builder =
       { new DocumentBuilder<MarkupSource>() with
           member __.AsMarkup e = e.ToString() }

   let doclet =
       { new MarkupSource() with
           override __.ToString() =
               """<?xml version='1.0' encoding='utf-8'?>
                  <root>
                    <pre xml:space='preserve'>
                      1. first
                      2. second
                      3. third
                    </pre>
                  </root>
             """ }

   builder.Create doclet
Multiple items
type MarkupSource = new: unit -> MarkupSource

--------------------
new: unit -> MarkupSource
val builder: obj
val doclet: MarkupSource

this.Create

Full Usage: this.Create

Parameters:
    source : 'TSource - Any type that can be represented as an (X/HT)ML string

Parses the markup provided by source and loads it into the underlying document object

source : 'TSource

Any type that can be represented as an (X/HT)ML string

XmlException Thrown if source could not be parsed or loaded successfully

this.TryCreate

Full Usage: this.TryCreate

Parameters:
    source : 'TSource - Any type that can be represented as an (X/HT)ML string

Returns: bool true if source was parsed and loaded successfully; otherwise false

Non-throwing alternative to DocumentBuilder.Create

source : 'TSource

Any type that can be represented as an (X/HT)ML string

Returns: bool

true if source was parsed and loaded successfully; otherwise false

Type something to start searching.