ReadOnlyBlueprint

How to get ReadOnlyBlueprint

ES2015+:

import ReadOnlyBlueprint from 'fontoxml-blueprints/readOnlyBlueprint'

ES5:

define([
	'fontoxml-blueprints/readOnlyBlueprint'
], function (
	ReadOnlyBlueprint
) {
});

Type: Class

A read-only blueprint can be used in APIs which require a Blueprint, only read from the DOM and a blueprint is not otherwise present.

Methods

Name Description
getAttribute

Returns the value of the given node's attribute with the given name


  Arguments
# Name Type Description
1. node Node

Node for which to retrieve the attribute value

2. attributeName String

Name of the attribute to be retrieved

  Returns

Type: String | Null

The value of the given attribute, or null if the attribute does not exist.

getAttributeNodeNS

Returns node's attribute with the given namespace and local name


  Arguments
# Name Type Description
1. node Node

The node to get the attribute node from

2. namespaceURI String | Null

The namespace uri of the attribute

3. localName String

the local name of the attribute

  Returns

Type: Attr | Null

The value of the given attribute, or null if the attribute does not exist.

getAttributeNS

Returns the value of the given node's attribute with the given namespace and local name


  Arguments
# Name Type Description
1. node Node

The node to get the attribute node from

2. namespaceURI String | Null

The namespace uri of the attribute

3. localName String

the local name of the attribute

  Returns

Type: String | Null

The value of the given attribute, or null if the attribute does not exist.

getChildNodes

Returns the child nodes of the given node according to the blueprint.


  Arguments
# Name Type Description
1. node Node

The node for which to retrieve the child nodes

  Returns

Type: Array<Node>

The child nodes of the given node

getData

Returns the data for the given node according to the ReadOnlyBlueprint.


  Arguments
# Name Type Description
1. node Node

The node for which to retrieve the data

  Returns

Type: String

The data for the given node

getFirstChild

Returns the first child of the given node according to the blueprint.


  Arguments
# Name Type Description
1. node Node

The node for which to retrieve the first child

  Returns

Type: Node | Null

The first child of the given node, or null if there is none

getLastChild

Returns the last child of the given node according to the blueprint.


  Arguments
# Name Type Description
1. node Node

The node for which to retrieve the last child

  Returns

Type: Node | Null

The last child of the given node, or null if there is none

getNextSibling

Returns the next sibling of the given node according to the blueprint.


  Arguments
# Name Type Description
1. node Node

The node for which to retrieve the next sibling

  Returns

Type: Node | Null

The next sibling of the given node, or null if there is none

getOwnerDocument

Returns the owner document of the given node according to the blueprint.

If the node is itself a Document, the owner document is null. Use blueprintQuery.getDocumentNode if you want the node itself in that case.


  Arguments
# Name Type Description
1. node Node
  Returns

Type: Document | Null

getParentNode

Returns the parent node of the given node according to the blueprint.


  Arguments
# Name Type Description
1. node Node

The node for which to retrieve the parent node

  Returns

Type: Node | Null

The parent node of the given node, or null if there is none

getPreviousSibling

Returns the previous sibling of the given node according to the blueprint.


  Arguments
# Name Type Description
1. node Node

The node for which to retrieve the previous sibling

  Returns

Type: Node | Null

The previous sibling of the given node, or null if there is none

Related links