2

I am building Magento 1 XSDs (XML Schema Definitions). Magento very often uses node names as a unique identifier for a node in XML.

For example:

<config>
    <events>
        <log_log_clean_after>
            <observers>
                <catalog_product_compare_item>
                    <class>catalog/observer</class>
                    <method>catalogProductCompareClean</method>
                </catalog_product_compare_item>
            </observers>
        </log_log_clean_after>
        <page_block_html_topmenu_gethtml_before>
            <observers>
                <catalog_add_topmenu_items>
                    <class>catalog/observer</class>
                    <method>addCatalogToTopmenuItems</method>
                </catalog_add_topmenu_items>
            </observers>
        </page_block_html_topmenu_gethtml_before>
        <catalog_entity_attribute_save_before>
            <observers>
                <catalog_check_reserved_attribute_codes>
                    <class>catalog/observer</class>
                    <method>checkReservedAttributeCodes</method>
                </catalog_check_reserved_attribute_codes>
            </observers>
        </catalog_entity_attribute_save_before>
    </events>
</config>

I know the structure of each node within the "events" node should have an "observers" which should contain observer definitions. And I know that an observer definition should have the structure of always containing one "class" node and one "method" node.

How do I specify this in an XSD? I have not been able to figure out how to specify structure for varied named nodes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.