Class: XSD::Any

Inherits:
BaseObject show all
Includes:
MinMaxOccurs
Defined in:
lib/xsd/objects/any.rb

Overview

The any element enables the author to extend the XML document with elements not specified by the schema. Parent elements: choice, sequence https://www.w3schools.com/xml/el_any.asp

Constant Summary

Constants inherited from BaseObject

BaseObject::NO_ATTRIBUTES_CONTAINER, BaseObject::NO_ELEMENTS_CONTAINER, BaseObject::XML_SCHEMA, BaseObject::XML_SCHEMA_NS

Instance Attribute Summary collapse

Attributes included from MinMaxOccurs

#max_occurs, #min_occurs

Attributes inherited from BaseObject

#id, #options

Instance Method Summary collapse

Methods included from MinMaxOccurs

#computed_max_occurs, #computed_min_occurs, included, #multiple?, #multiple_allowed?

Methods inherited from BaseObject

#[], child, #collect_attributes, #collect_elements, #documentation, #documentation_for, #get_prefix, #initialize, #inspect, link, #map_child, #map_children, mapped_name, #namespaces, #node, #node_to_object, #nodes, #object_by_name, #parent, property, #reader, #schema, #schemas_for_namespace, #strip_prefix, to_underscore

Constructor Details

This class inherits a constructor from XSD::BaseObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class XSD::BaseObject

Instance Attribute Details

#namespace ⇒ Object

Optional. Specifies the namespaces containing the elements that can be used. Can be set to one of the following: ##any - elements from any namespace is allowed (this is default) ##other - elements from any namespace that is not the namespace of the parent element can be present ##local - elements must come from no namespace ##targetNamespace - elements from the namespace of the parent element can be present List of references of namespaces, ##targetNamespace, ##local - elements from a space-delimited list of the namespaces can be present

Returns:

  • String



19
# File 'lib/xsd/objects/any.rb', line 19

property :namespace, :string, default: '##any'

#process_contents ⇒ Object

Optional. Specifies how the XML processor should handle validation against the elements specified by this any element. Can be set to one of the following:

strict - the XML processor must obtain the schema
for the required namespaces and validate the elements (this is default)
lax - same as strict but; if the schema cannot be obtained, no errors will occur
skip - The XML processor does not attempt to validate any elements from the specified namespaces

Returns:

  • String, nil



29
# File 'lib/xsd/objects/any.rb', line 29

property :processContents, :string, default: 'strict'

Instance Method Details

#name ⇒ Object

Get virtual element name

Returns:

  • String



33
34
35
# File 'lib/xsd/objects/any.rb', line 33

def name
  '#any'
end