/** * The content of appinfo is a raw W3C nodelist. It is convenient to put * this nodelist inside a DOM fragment called parent markup that we create * or recover here. * * @param appInfo the application info element * @return a parent DOM fragment for the annotation nodes list */ protected DocumentFragment getMarkupParent(final XmlSchemaAppInfo appInfo) { NodeList markup = appInfo.getMarkup(); DocumentFragment markupParent = null; if (markup == null || markup.getLength() == 0) { markupParent = _db.newDocument().createDocumentFragment(); } else { markupParent = (DocumentFragment) markup.item(0).getParentNode(); } return markupParent; }
/** * Extracts the cobol annotation from an XML schema element. * * @param xsdElement the XML schema element * @return the COBOL annotation or bull if none found */ protected Element getCobolAnnotation(XmlSchemaElement xsdElement) { XmlSchemaAnnotation annotation = xsdElement.getAnnotation(); if (annotation != null && annotation.getItems().getCount() > 0) { XmlSchemaAppInfo appinfo = (XmlSchemaAppInfo) annotation.getItems() .getItem(0); if (appinfo.getMarkup() != null) { for (int i = 0; i < appinfo.getMarkup().getLength(); i++) { Node node = appinfo.getMarkup().item(i); if (node instanceof Element && node.getLocalName().equals(CobolMarkup.ELEMENT) && node.getNamespaceURI().equals(CobolMarkup.NS)) { return (Element) node; } } } } return null; }
/** {@inheritDoc} */ public void processElement(final XmlSchema schema, final XmlSchemaElement xsdElement, final int level) throws XsdMappingException { XmlSchemaAnnotation annotation = xsdElement.getAnnotation(); if (annotation != null && annotation.getItems().getCount() > 0) { XmlSchemaAppInfo appinfo = (XmlSchemaAppInfo) annotation.getItems() .getItem(0); if (appinfo.getMarkup() != null) { for (int i = 0; i < appinfo.getMarkup().getLength(); i++) { Node node = appinfo.getMarkup().item(i); if (node instanceof Element && node.getLocalName().equals(CobolMarkup.ELEMENT) && node.getNamespaceURI().equals(CobolMarkup.NS)) { writeElement(schema, xsdElement, _writer, (Element) node, level); } } } } }
XmlSchemaAppInfo appInfo = (XmlSchemaAppInfo)item; if (appInfo != null) { NodeList nlist = appInfo.getMarkup(); Node node = nlist.item(0); String info = node.getNodeValue();
NodeList markup = appInfo.getMarkup(); if (markup == null || markup.getLength() == 0) {
NodeList nlist = appInfo.getMarkup(); Node node = nlist.item(0); String info = node.getNodeValue();