XsdGenerator
class XsdGenerator extends AbstractGenerator (View source)
XML Schema (XSD) Generator. Will generate an XML schema which can be used for auto-completion in schema-aware editors like Eclipse XML editor.
Properties
protected ClassReflection | $abstractViewHelperReflectionClass | The reflection class for AbstractViewHelper. Is needed quite often, that's why we use a pre-initialized one. |
from AbstractGenerator |
protected DocCommentParser | $docCommentParser | The doc comment parser. |
from AbstractGenerator |
protected ReflectionService | $reflectionService | from AbstractGenerator | |
protected ObjectManagerInterface | $objectManager |
Methods
Get all class names inside this namespace and return them as array.
Get a tag name for a given ViewHelper class.
Add a child node to $parentXmlNode, and wrap the contents inside a CDATA section.
Generate the XML Schema definition for a given namespace.
Generate the XML Schema for a given class name.
Add attribute descriptions to a given tag.
Add documentation XSD to a given XML node
Details
__construct()
Constructor. Sets $this->abstractViewHelperReflectionClass
protected array
getClassNamesInNamespace(string $namespace)
Get all class names inside this namespace and return them as array.
protected string
getTagNameForClass(string $className, string $namespace)
Get a tag name for a given ViewHelper class.
Example: For the View Helper Neos\FluidAdaptor\ViewHelpers\Form\SelectViewHelper, and the namespace prefix Neos\FluidAdaptor\ViewHelpers\, this method returns "form.select".
protected SimpleXMLElement
addChildWithCData(SimpleXMLElement $parentXmlNode, string $childNodeName, string $childNodeValue)
Add a child node to $parentXmlNode, and wrap the contents inside a CDATA section.
string
generateXsd(string $viewHelperNamespace, string $xsdNamespace)
Generate the XML Schema definition for a given namespace.
It will generate an XSD file for all view helpers in this namespace.
protected void
generateXmlForClassName(string $className, string $viewHelperNamespace, SimpleXMLElement $xmlRootNode)
Generate the XML Schema for a given class name.
protected void
addAttributes(string $className, SimpleXMLElement $xsdElement)
Add attribute descriptions to a given tag.
Initializes the view helper and its arguments, and then reads out the list of arguments.
protected void
addDocumentation(string $documentation, SimpleXMLElement $xsdParentNode)
Add documentation XSD to a given XML node