use of org.eclipse.wst.xml.core.internal.contentmodel.CMNode in project webtools.sourceediting by eclipse.
the class DOMContentBuilderImpl method getSubstitution.
protected CMElementDeclaration getSubstitution(CMElementDeclaration ed) {
CMElementDeclaration result = ed;
// $NON-NLS-1$
CMNodeList l = (CMNodeList) ed.getProperty("SubstitutionGroup");
if (l != null) {
for (int i = 0; i < l.getLength(); i++) {
CMNode candidate = l.item(i);
if (!isAbstract(candidate) && (candidate instanceof CMElementDeclaration)) {
result = (CMElementDeclaration) candidate;
break;
}
}
}
return result;
}
use of org.eclipse.wst.xml.core.internal.contentmodel.CMNode in project webtools.sourceediting by eclipse.
the class CMValidator method getNextSiblings.
public CMNode[] getNextSiblings(CMElementDeclaration ed, String elementName) {
List arcList = getMatchingArcs(ed, elementName);
List nextSiblingList = new ArrayList();
for (Iterator i = arcList.iterator(); i.hasNext(); ) {
Arc arc = (Arc) i.next();
collectNextSiblings(arc.node, nextSiblingList, new ArrayList(), new ArrayList(), 0);
}
CMNode[] result = new CMNode[nextSiblingList.size()];
nextSiblingList.toArray(result);
// System.out.println();
return result;
}
use of org.eclipse.wst.xml.core.internal.contentmodel.CMNode in project webtools.sourceediting by eclipse.
the class CtdDatalist method createContent.
/**
* (OPTION)+.
*/
protected void createContent() {
if (content != null)
// already created.
return;
if (collection == null)
return;
content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
// OPTION
CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.OPTION);
if (dec != null)
content.appendChild(dec);
}
use of org.eclipse.wst.xml.core.internal.contentmodel.CMNode in project webtools.sourceediting by eclipse.
the class CtdMediaElement method createContent.
/* (non-Javadoc)
* @see org.eclipse.wst.html.core.internal.contentmodel.ComplexTypeDefinition#createContent()
*/
protected void createContent() {
if (content != null)
// already created.
return;
if (collection == null)
return;
// ( )*
content = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
// source
CMNode source = collection.getNamedItem(HTML50Namespace.ElementName.SOURCE);
if (source != null)
content.appendChild(source);
}
use of org.eclipse.wst.xml.core.internal.contentmodel.CMNode in project webtools.sourceediting by eclipse.
the class CtdOptionContainer method createContent.
/**
* (OPTION)+.
*/
protected void createContent() {
if (content != null)
// already created.
return;
if (collection == null)
return;
// ( )+
content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
// OPTION
CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.OPTION);
if (dec != null)
content.appendChild(dec);
}
Aggregations