Search in sources :

Example 1 with XmlElementDescriptorImpl

use of com.intellij.xml.impl.dtd.XmlElementDescriptorImpl in project intellij-community by JetBrains.

the class XmlDtdTest method testElementDescriptor4.

public void testElementDescriptor4() throws Exception {
    XmlNSDescriptor NSDescriptor = createDescriptor("<!ELEMENT orion-application (ejb-module*, persistence?, namespace-access)>" + "<!ELEMENT ejb-module ANY>" + "<!ELEMENT persistence ANY>" + "<!ELEMENT namespace-access ANY>");
    XmlTag documentTag = tag("orion-application");
    XmlElementDescriptorImpl elementDescriptor = (XmlElementDescriptorImpl) NSDescriptor.getElementDescriptor(documentTag);
    XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(documentTag);
    assertEquals(3, elements.length);
    assertEquals("ejb-module", elements[0].getName());
    assertEquals("persistence", elements[1].getName());
    assertEquals("namespace-access", elements[2].getName());
    elements = elements[0].getElementsDescriptors(documentTag);
    assertEquals(4, elements.length);
    assertEquals("orion-application", elements[0].getName());
    assertEquals("ejb-module", elements[1].getName());
    assertEquals("persistence", elements[2].getName());
    assertEquals("namespace-access", elements[3].getName());
}
Also used : XmlNSDescriptor(com.intellij.xml.XmlNSDescriptor) XmlElementDescriptorImpl(com.intellij.xml.impl.dtd.XmlElementDescriptorImpl) XmlElementDescriptor(com.intellij.xml.XmlElementDescriptor) XmlTag(com.intellij.psi.xml.XmlTag)

Aggregations

XmlTag (com.intellij.psi.xml.XmlTag)1 XmlElementDescriptor (com.intellij.xml.XmlElementDescriptor)1 XmlNSDescriptor (com.intellij.xml.XmlNSDescriptor)1 XmlElementDescriptorImpl (com.intellij.xml.impl.dtd.XmlElementDescriptorImpl)1