Class: XSD::AnyAttribute

Inherits:
BaseObject show all
Defined in:
lib/xsd/objects/any_attribute.rb

Overview

The anyAttribute element enables the author to extend the XML document with attributes not specified by the schema. Parent elements: complexType, restriction (both simpleContent and complexContent), extension (both simpleContent and complexContent), attributeGroup www.w3schools.com/xml/el_anyattribute.asp

Constant Summary

Constants inherited from BaseObject

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

Instance Attribute Summary collapse

Attributes inherited from BaseObject

#id, #options

Instance Method Summary collapse

Methods inherited from BaseObject

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

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

#namespaceObject

Optional. Specifies the namespaces containing the attributes that can be used. Can be set to one of the following:

##any             - attributes from any namespace is allowed (this is default)
##other           - attributes from any namespace that is not the namespace of the parent element can be present
##local           - attributes must come from no namespace
##targetNamespace - attributes from the namespace of the parent element can be present
  List of {URI references of namespaces, ##targetNamespace, ##local} - attributes from a space-delimited list
                     of the namespaces can be present

Returns:

  • String



18
# File 'lib/xsd/objects/any_attribute.rb', line 18

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

#process_contentsObject

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



28
# File 'lib/xsd/objects/any_attribute.rb', line 28

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

Instance Method Details

#nameObject

Get virtual attribute name

Returns:

  • String



32
33
34
# File 'lib/xsd/objects/any_attribute.rb', line 32

def name
  '#anyAttribute'
end