Java Code Examples for com.intellij.psi.xml.XmlTag#getAttribute()

The following examples show how to use com.intellij.psi.xml.XmlTag#getAttribute() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LatteXmlFileDataFactory.java    From intellij-latte with MIT License 6 votes vote down vote up
private static void loadTags(XmlTag customTags, LatteXmlFileData data) {
    for (XmlTag tag : customTags.findSubTags("tag")) {
        XmlAttribute name = tag.getAttribute("name");
        XmlAttribute type = tag.getAttribute("type");
        if (name == null || type == null || !LatteTagSettings.isValidType(type.getValue())) {
            continue;
        }

        LatteTagSettings macro = new LatteTagSettings(
                name.getValue(),
                LatteTagSettings.Type.valueOf(type.getValue()),
                isTrue(tag, "allowedFilters"),
                getTextValue(tag, "arguments"),
                isTrue(tag, "multiLine"),
                getTextValue(tag, "deprecatedMessage").trim(),
                getArguments(tag)
        );

        data.addTag(macro);
    }
}
 
Example 2
Source File: RouteHelper.java    From idea-php-symfony2-plugin with MIT License 6 votes vote down vote up
@Nullable
public static PsiElement getXmlRouteNameTarget(@NotNull XmlFile psiFile,@NotNull String routeName) {

    XmlDocumentImpl document = PsiTreeUtil.getChildOfType(psiFile, XmlDocumentImpl.class);
    if(document == null) {
        return null;
    }

    for(XmlTag xmlTag: PsiTreeUtil.getChildrenOfTypeAsList(psiFile.getFirstChild(), XmlTag.class)) {
        if(xmlTag.getName().equals("routes")) {
            for(XmlTag routeTag: xmlTag.getSubTags()) {
                if(routeTag.getName().equals("route")) {
                    XmlAttribute xmlAttribute = routeTag.getAttribute("id");
                    if(xmlAttribute != null) {
                        String attrValue = xmlAttribute.getValue();
                        if(routeName.equals(attrValue)) {
                            return xmlAttribute;
                        }
                    }
                }
            }
        }
    }

    return null;
}
 
Example 3
Source File: ControllerMethodInspection.java    From idea-php-symfony2-plugin with MIT License 6 votes vote down vote up
@Nullable
@Override
public String getRouteName() {

    XmlTag defaultTag = PsiTreeUtil.getParentOfType(this.psiElement, XmlTag.class);
    if(defaultTag != null) {
        XmlTag routeTag = PsiTreeUtil.getParentOfType(defaultTag, XmlTag.class);
        if(routeTag != null) {
            XmlAttribute id = routeTag.getAttribute("id");
            if(id != null) {
                return id.getValue();
            }
        }
    }

    return null;
}
 
Example 4
Source File: LatteXmlFileDataFactory.java    From intellij-latte with MIT License 6 votes vote down vote up
private static void loadFilters(XmlTag customFilters, LatteXmlFileData data) {
    for (XmlTag filterData : customFilters.findSubTags("filter")) {
        XmlAttribute name = filterData.getAttribute("name");
        if (name == null) {
            continue;
        }

        LatteFilterSettings filter = new LatteFilterSettings(
                name.getValue(),
                getTextValue(filterData, "description"),
                getTextValue(filterData, "arguments"),
                getTextValue(filterData, "insertColons")
        );
        data.addFilter(filter);
    }
}
 
Example 5
Source File: MuleSchemaUtils.java    From mule-intellij-plugins with Apache License 2.0 6 votes vote down vote up
public static void insertSchemaLocationLookup(XmlFile xmlFile, String namespace, String locationLookup) {
    final XmlTag rootTag = xmlFile.getRootTag();
    if (rootTag == null)
        return;
    final XmlAttribute attribute = rootTag.getAttribute("xsi:schemaLocation", HTTP_WWW_W3_ORG_2001_XMLSCHEMA);
    if (attribute != null) {
        final String value = attribute.getValue();
        attribute.setValue(value + "\n\t\t\t" + namespace + " " + locationLookup);
    } else {
        final XmlElementFactory elementFactory = XmlElementFactory.getInstance(xmlFile.getProject());
        final XmlAttribute schemaLocation = elementFactory.createXmlAttribute("xsi:schemaLocation", XmlUtil.XML_SCHEMA_INSTANCE_URI);
        schemaLocation.setValue(namespace + " " + locationLookup);
        rootTag.add(schemaLocation);
    }

}
 
Example 6
Source File: MuleConfigUtils.java    From mule-intellij-plugins with Apache License 2.0 5 votes vote down vote up
public static String getMulePath(XmlTag tag) {
    final LinkedList<XmlTag> elements = new LinkedList<>();
    while (!isMuleTag(tag)) {
        elements.push(tag);
        tag = tag.getParentTag();
    }
    String path = "";
    for (int i = 0; i < elements.size(); i++) {
        final XmlTag element = elements.get(i);
        switch (i) {
            case 0: {
                final XmlAttribute name = element.getAttribute(MuleConfigConstants.NAME_ATTRIBUTE);
                if (name != null) {
                    path = "/" + MulePathUtils.escape(name.getValue()) + getGlobalElementCategory(element);
                }
                break;
            }
            default: {
                final XmlTag parentTag = element.getParentTag();
                int index = 0;
                for (XmlTag xmlTag : parentTag.getSubTags()) {
                    if (xmlTag == element) {
                        break;
                    }
                    final MuleElementType muleElementType = getMuleElementTypeFromXmlElement(xmlTag);
                    if (muleElementType == MuleElementType.MESSAGE_PROCESSOR) {
                        index = index + 1;
                    }
                }
                path = path + "/" + index;
            }
        }
    }
    System.out.println("path = " + path);
    return path;
}
 
Example 7
Source File: LatteXmlFileInspection.java    From intellij-latte with MIT License 5 votes vote down vote up
@Nullable
@Override
public ProblemDescriptor[] checkFile(@NotNull PsiFile file, @NotNull final InspectionManager manager, final boolean isOnTheFly) {
	if (!(file instanceof XmlFile) || file.getLanguage() != XMLLanguage.INSTANCE || !file.getName().equals(LatteFileConfiguration.FILE_NAME)) {
		return null;
	}

	final List<ProblemDescriptor> problems = new ArrayList<>();

	XmlDocument xmlDocument = ((XmlFile) file).getDocument();
	if (xmlDocument == null) {
		addError(manager, problems, file, "Root tag <latte> is missing", isOnTheFly);
		return problems.toArray(new ProblemDescriptor[0]);
	}

	if (xmlDocument.getRootTag() == null || !xmlDocument.getRootTag().getName().equals("latte")) {
		addError(manager, problems, file, "Root tag <latte> is missing", isOnTheFly);
		return problems.toArray(new ProblemDescriptor[0]);
	}

	XmlTag rootTag = xmlDocument.getRootTag();
	if (rootTag.getAttribute("vendor") == null) {
		PsiElement psiElement = rootTag.getFirstChild().getNextSibling();
		addError(
				manager,
				problems,
				psiElement != null ? psiElement : file,
				"Missing required attribute `vendor` on tag <latte>. It must be unique name like composer package name.",
				isOnTheFly
		);
	}

	return problems.toArray(new ProblemDescriptor[0]);
}
 
Example 8
Source File: NMEBuildDirectoryInspection.java    From intellij-haxe with Apache License 2.0 5 votes vote down vote up
@Override
public void visitXmlTag(XmlTag tag) {
  super.visitXmlTag(tag);
  if ("set".equals(tag.getName())) {
    final XmlAttribute name = tag.getAttribute("name");
    if ("BUILD_DIR".equals(name != null ? name.getValue() : null)) {
      myResult.add(tag);
    }
  }
}
 
Example 9
Source File: XmlCompletionContributor.java    From idea-php-symfony2-plugin with MIT License 5 votes vote down vote up
@Override
protected void addCompletions(@NotNull CompletionParameters completionParameters, ProcessingContext processingContext, final @NotNull CompletionResultSet completionResultSet) {
    PsiElement psiElement = completionParameters.getOriginalPosition();
    if(psiElement == null || !Symfony2ProjectComponent.isEnabled(psiElement)) {
        return;
    }

    XmlTag xmlTag = PsiTreeUtil.getParentOfType(psiElement, XmlTag.class);
    if(xmlTag == null) {
        return;
    }

    XmlTag xmlTagService = PsiTreeUtil.getParentOfType(xmlTag, XmlTag.class);
    if(xmlTagService != null) {
        XmlAttribute xmlAttribute = xmlTagService.getAttribute("class");
        if(xmlAttribute != null) {
            String value = xmlAttribute.getValue();
            if(value != null && StringUtils.isNotBlank(value)) {
                PhpClass phpClass = ServiceUtil.getResolvedClassDefinition(psiElement.getProject(), value);
                if(phpClass != null) {
                    FormUtil.attachFormAliasesCompletions(phpClass, completionResultSet);
                }
            }
        }
    }

}
 
Example 10
Source File: ServiceActionUtil.java    From idea-php-symfony2-plugin with MIT License 5 votes vote down vote up
public static boolean isValidXmlParameterInspectionService(@NotNull XmlTag xmlTag) {

        // we dont support some attributes right now
        for(String s : INVALID_ARGUMENT_ATTRIBUTES) {
            if(xmlTag.getAttribute(s) != null) {
                return false;
            }
        }

        // <service autowire="[false|true]"/>
        String autowire = xmlTag.getAttributeValue("autowire");
        if("true".equalsIgnoreCase(autowire)) {
            return false;
        } else if("false".equalsIgnoreCase(autowire)) {
            return true;
        }

        // <service><factory/></service>
        // symfony2 >= 2.6
        if(xmlTag.findSubTags("factory").length > 0) {
            return false;
        }

        // <services autowire="true"><defaults/></services>
        PsiElement servicesTag = xmlTag.getParent();
        if(servicesTag instanceof XmlTag &&  "services".equals(((XmlTag) servicesTag).getName())) {
            // <defaults autowire="true" />
            for (XmlTag defaults : ((XmlTag) servicesTag).findSubTags("defaults")) {
                if("true".equalsIgnoreCase(defaults.getAttributeValue("autowire"))) {
                    return false;
                }
            }
        }

        return true;
    }
 
Example 11
Source File: ConfigRefPsiReference.java    From mule-intellij-plugins with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public PsiElement resolve() {
    final String elementName = getElementName();
    final XmlTag globalElement = MuleConfigUtils.findGlobalElement(myElement, elementName);
    if (globalElement != null) {
        final XmlAttribute name = globalElement.getAttribute(MuleConfigConstants.NAME_ATTRIBUTE);
        return name != null ? name.getValueElement() : null;
    }
    return null;
}
 
Example 12
Source File: FlowRefPsiReference.java    From mule-intellij-plugins with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public PsiElement resolve() {
    final String flowName = getFlowName();
    final XmlTag flow = MuleConfigUtils.findFlow(myElement, flowName);
    if (flow != null) {
        final XmlAttribute name = flow.getAttribute(MuleConfigConstants.NAME_ATTRIBUTE);
        return name != null ? name.getValueElement() : null;
    }
    return null;
}
 
Example 13
Source File: LatteXmlFileDataFactory.java    From intellij-latte with MIT License 5 votes vote down vote up
private static List<LatteArgumentSettings> getArguments(XmlTag tag) {
    XmlTag arguments = tag.findFirstSubTag("arguments");
    if (arguments == null) {
        return Collections.emptyList();
    }

    List<LatteArgumentSettings> out = new ArrayList<>();
    for (XmlTag argument : arguments.findSubTags("argument")) {
        XmlAttribute name = argument.getAttribute("name");
        XmlAttribute typesString = argument.getAttribute("types");
        if (name == null || typesString == null) {
            continue;
        }

        LatteArgumentSettings.Type[] types = LatteArgumentSettings.getTypes(typesString.getValue());
        if (types == null) {
            continue;
        }

        String validType = getTextValue(argument, "validType");
        LatteArgumentSettings instance = new LatteArgumentSettings(
                name.getValue(),
                types,
                validType.length() == 0 ? "mixed" : validType,
                isTrue(argument, "required"),
                isTrue(argument, "repeatable")
        );
        out.add(instance);
    }
    return out;
}
 
Example 14
Source File: InTemplateDeclarationVariableProvider.java    From idea-php-typo3-plugin with MIT License 5 votes vote down vote up
@Override
public void visitXmlTag(XmlTag tag) {
    if (tag.getName().equals("f:alias")) {
        XmlAttribute map = tag.getAttribute("map");
        if (map != null) {
            XmlAttributeValue valueElement = map.getValueElement();
            if (valueElement != null) {
                TextRange valueTextRange = valueElement.getValueTextRange();

                PsiElement fluidElement = extractLanguagePsiElementForElementAtPosition(FluidLanguage.INSTANCE, tag, valueTextRange.getStartOffset() + 1);

                FluidArrayCreationExpr fluidArray = (FluidArrayCreationExpr) PsiTreeUtil.findFirstParent(fluidElement, x -> x instanceof FluidArrayCreationExpr);
                if (fluidArray != null) {
                    fluidArray.getArrayKeyList().forEach(fluidArrayKey -> {
                        if (fluidArrayKey.getFirstChild() instanceof FluidStringLiteral) {
                            String key = ((FluidStringLiteral) fluidArrayKey.getFirstChild()).getContents();
                            variables.put(key, new FluidVariable(key));

                            return;
                        }

                        variables.put(fluidArrayKey.getText(), new FluidVariable(fluidArrayKey.getText()));
                    });
                }
            }
        }
    }

    super.visitXmlTag(tag);
}
 
Example 15
Source File: DefaultViewHelpersProvider.java    From idea-php-typo3-plugin with MIT License 4 votes vote down vote up
@Override
public void visitXmlTag(XmlTag tag) {
    if (!tag.getName().equals("xsd:element")) {
        super.visitXmlTag(tag);

        return;
    }

    XmlAttribute nameAttribute = tag.getAttribute("name");
    if (nameAttribute == null || nameAttribute.getValue() == null) {
        super.visitXmlTag(tag);

        return;
    }

    ViewHelper viewHelper = new ViewHelper(nameAttribute.getValue());
    viewHelper.setDocumentation(extractDocumentation(tag));

    XmlTag complexType = tag.findFirstSubTag("xsd:complexType");
    if (complexType != null) {
        XmlTag[] attributeTags = complexType.findSubTags("xsd:attribute");
        for (XmlTag attributeTag : attributeTags) {
            String argumentName = attributeTag.getAttributeValue("name");
            if (argumentName == null) {
                continue;
            }

            ViewHelperArgument argument = new ViewHelperArgument(argumentName);

            argument.setDocumentation(extractDocumentation(attributeTag));

            String attributeType = attributeTag.getAttributeValue("php:type");
            if (attributeType == null) {
                argument.setType("mixed");
            } else {
                argument.setType(attributeType);
            }

            String requiredAttribute = attributeTag.getAttributeValue("use");
            if (requiredAttribute != null && requiredAttribute.equals("required")) {
                argument.setRequired(true);
            }

            viewHelper.addArgument(argumentName, argument);
        }
    }

    viewHelpers.put(nameAttribute.getValue(), viewHelper);

    super.visitXmlTag(tag);
}
 
Example 16
Source File: FormUtil.java    From idea-php-symfony2-plugin with MIT License 4 votes vote down vote up
public static Map<String, Set<String>> getTags(@NotNull XmlFile psiFile) {
    Map<String, Set<String>> map = new HashMap<>();

    XmlDocumentImpl document = PsiTreeUtil.getChildOfType(psiFile, XmlDocumentImpl.class);
    if(document == null) {
        return map;
    }

    /*
     * <services>
     *   <service id="espend_form.foo_type" class="%espend_form.foo_type.class%">
     *     <tag name="form.type" alias="foo_type_alias" />
     *   </service>
     * </services>
     */

    XmlTag xmlTags[] = PsiTreeUtil.getChildrenOfType(psiFile.getFirstChild(), XmlTag.class);
    if(xmlTags == null) {
        return map;
    }

    for(XmlTag xmlTag: xmlTags) {
        if(xmlTag.getName().equals("container")) {
            for(XmlTag servicesTag: xmlTag.getSubTags()) {
                if(servicesTag.getName().equals("services")) {
                    for(XmlTag serviceTag: servicesTag.getSubTags()) {
                        XmlAttribute attrValue = serviceTag.getAttribute("id");
                        if(attrValue != null) {

                            // <service id="foo.bar" class="Class\Name">
                            String serviceNameId = attrValue.getValue();
                            if(serviceNameId != null) {

                                Set<String> serviceTags = getTags(serviceTag);
                                if(serviceTags.size() > 0) {
                                    map.put(serviceNameId, serviceTags);
                                }
                            }

                        }
                    }
                }
            }
        }
    }

    return map;
}
 
Example 17
Source File: RouteHelper.java    From idea-php-symfony2-plugin with MIT License 4 votes vote down vote up
public static Collection<StubIndexedRoute> getXmlRouteDefinitions(XmlFile psiFile) {

        XmlDocumentImpl document = PsiTreeUtil.getChildOfType(psiFile, XmlDocumentImpl.class);
        if(document == null) {
            return Collections.emptyList();
        }

        Collection<StubIndexedRoute> indexedRoutes = new ArrayList<>();

        /*
         * <routes>
         *   <route id="foo" path="/blog/{slug}" methods="GET">
         *     <default key="_controller">Foo</default>
         *   </route>
         *
         *   <route id="foo" path="/blog/{slug}" methods="GET" controller="AppBundle:Blog:list"/>
         * </routes>
         */
        for(XmlTag xmlTag: PsiTreeUtil.getChildrenOfTypeAsList(psiFile.getFirstChild(), XmlTag.class)) {
            if(xmlTag.getName().equals("routes")) {
                for(XmlTag servicesTag: xmlTag.getSubTags()) {
                    if(servicesTag.getName().equals("route")) {
                        XmlAttribute xmlAttribute = servicesTag.getAttribute("id");
                        if(xmlAttribute != null) {
                            String attrValue = xmlAttribute.getValue();
                            if(attrValue != null && StringUtils.isNotBlank(attrValue)) {

                                StubIndexedRoute route = new StubIndexedRoute(attrValue);
                                String pathAttribute = servicesTag.getAttributeValue("path");
                                if(pathAttribute == null) {
                                    pathAttribute = servicesTag.getAttributeValue("pattern");
                                }

                                if(pathAttribute != null && StringUtils.isNotBlank(pathAttribute) ) {
                                    route.setPath(pathAttribute);
                                }

                                String methods = servicesTag.getAttributeValue("methods");
                                if(methods != null && StringUtils.isNotBlank(methods))  {
                                    String[] split = methods.replaceAll(" +", "").toLowerCase().split("\\|");
                                    if(split.length > 0) {
                                        route.addMethod(split);
                                    }
                                }

                                // <route><default key="_controller"/></route>
                                //  <route controller="AppBundle:Blog:list"/>
                                String controller = getXmlController(servicesTag);
                                if(controller != null) {
                                    route.setController(normalizeRouteController(controller));
                                }

                                indexedRoutes.add(route);
                            }
                        }
                    }
                }
            }
        }

        return indexedRoutes;
    }
 
Example 18
Source File: Transformer.java    From svgtoandroid with MIT License 4 votes vote down vote up
private void parseShapeNode(XmlTag srcTag, XmlTag distTag, Map<String, String> existedAttrs) {
    if (existedAttrs == null) {
        existedAttrs = new HashMap<String, String>();
    }
    List<XmlTag> childes = svgParser.getShapeTags(srcTag);

    List<XmlTag> useTags = svgParser.getUseTags(srcTag);
    Map<String, XmlTag> defsTags = svgParser.getAcceptedDefNodes();
    for (XmlTag useTag : useTags) {
        String href = useTag.getAttributeValue("xlink:href");
        XmlTag def = defsTags.get(href.replace("#", ""));
        if (def != null) {
            XmlTag clonedTag = (XmlTag) def.copy();
            for (XmlAttribute attribute : useTag.getAttributes()) {
                if (!"xlink:href".equalsIgnoreCase(attribute.getName())) {
                    clonedTag.setAttribute(attribute.getName(), attribute.getValue());
                }
            }
            childes.add(clonedTag);
        }
    }

    for (XmlTag child : childes) {
        XmlTag pathElement = distTag.createChildTag("path", distTag.getNamespace(), null, false);
        Map<String, String> myAttrs = new HashMap<String, String>();
        myAttrs.putAll(existedAttrs);
        myAttrs.putAll(svgParser.getChildAttrs(child));
        Logger.debug("Existed attrs: " + myAttrs);

        XmlAttribute id = child.getAttribute("class");
        String idValue = id == null ? null : id.getValue();
        if (idValue != null) {
            pathElement.setAttribute("android:name", idValue);
        }

        pathElement.setAttribute("android:fillColor", decideFillColor(srcTag, child));

        for (String svgElementAttribute : myAttrs.keySet()) {
            if (AttrMapper.getAttrName(svgElementAttribute) != null && AttrMapper.getAttrName(svgElementAttribute).contains("Color")) {
                pathElement.setAttribute(AttrMapper.getAttrName(svgElementAttribute), StdColorUtil.formatColor(myAttrs.get(svgElementAttribute)));
            } else if (AttrMapper.getAttrName(svgElementAttribute) != null) {
                if (AttrMapper.getAttrName(svgElementAttribute).equals("android:fillType")) {
                    String value = myAttrs.get(svgElementAttribute).toLowerCase();
                    String xmlValue = "nonZero";
                    if (value.equals("evenodd")) {
                        xmlValue = "evenOdd";
                    }
                    pathElement.setAttribute("android:fillType", xmlValue);
                } else {
                    pathElement.setAttribute(AttrMapper.getAttrName(svgElementAttribute), myAttrs.get(svgElementAttribute));
                }
            }
        }

        if (AttrMapper.isShapeName(child.getName())) {
            pathElement.setAttribute("android:pathData", SVGAttrParser.getPathData(child));
        }

        distTag.addSubTag(pathElement, false);
    }
}
 
Example 19
Source File: XmlServiceTagIntention.java    From idea-php-symfony2-plugin with MIT License 4 votes vote down vote up
@Override
public void invoke(@NotNull final Project project, final Editor editor, @NotNull PsiElement psiElement) throws IncorrectOperationException {

    final XmlTag xmlTag = XmlServiceArgumentIntention.getServiceTagValid(psiElement);
    if(xmlTag == null) {
        return;
    }

    final PhpClass phpClassFromXmlTag = ServiceActionUtil.getPhpClassFromXmlTag(xmlTag, new ContainerCollectionResolver.LazyServiceCollector(project));
    if(phpClassFromXmlTag == null) {
        return;
    }

    Set<String> phpServiceTags = ServiceUtil.getPhpClassServiceTags(phpClassFromXmlTag);
    if(phpServiceTags.size() == 0) {
        HintManager.getInstance().showErrorHint(editor, "Ops, no possible Tag found");
        return;
    }

    for (XmlTag tag : xmlTag.getSubTags()) {

        if(!"tag".equals(tag.getName())) {
            continue;
        }

        XmlAttribute name = tag.getAttribute("name");
        if(name == null) {
            continue;
        }

        String value = name.getValue();
        if(phpServiceTags.contains(value)) {
            phpServiceTags.remove(value);
        }

    }

    ServiceUtil.insertTagWithPopupDecision(editor, phpServiceTags, tag -> {
        ServiceTag serviceTag = new ServiceTag(phpClassFromXmlTag, tag);
        ServiceUtil.decorateServiceTag(serviceTag);
        xmlTag.addSubTag(XmlElementFactory.getInstance(project).createTagFromText(serviceTag.toXmlString()), false);
    });
}
 
Example 20
Source File: XmlDuplicateServiceKeyInspection.java    From idea-php-symfony2-plugin with MIT License 4 votes vote down vote up
protected void visitRoot(PsiFile psiFile, @NotNull ProblemsHolder holder, String root, String child, String tagName) {

        XmlDocument xmlDocument = PsiTreeUtil.getChildOfType(psiFile, XmlDocument.class);
        if(xmlDocument == null) {
            return;
        }

        Map<String, XmlAttribute> psiElementMap = new HashMap<>();
        Set<XmlAttribute> yamlKeyValues = new HashSet<>();

        for(XmlTag xmlTag: PsiTreeUtil.getChildrenOfTypeAsList(psiFile.getFirstChild(), XmlTag.class)) {
            if(xmlTag.getName().equals("container")) {
                for(XmlTag servicesTag: xmlTag.getSubTags()) {
                    if(servicesTag.getName().equals(root)) {
                        for(XmlTag parameterTag: servicesTag.getSubTags()) {
                            if(parameterTag.getName().equals(child)) {
                                XmlAttribute keyAttr = parameterTag.getAttribute(tagName);
                                if(keyAttr != null) {
                                    String parameterName = keyAttr.getValue();
                                    if(parameterName != null && StringUtils.isNotBlank(parameterName)) {
                                        if(psiElementMap.containsKey(parameterName)) {
                                            yamlKeyValues.add(psiElementMap.get(parameterName));
                                            yamlKeyValues.add(keyAttr);
                                        } else {
                                            psiElementMap.put(parameterName, keyAttr);
                                        }
                                    }

                                }
                            }
                        }
                    }
                }
            }
        }

        if(yamlKeyValues.size() > 0) {
            for(PsiElement psiElement: yamlKeyValues) {
                XmlAttributeValue valueElement = ((XmlAttribute) psiElement).getValueElement();
                if(valueElement != null) {
                    holder.registerProblem(valueElement, "Duplicate Key", ProblemHighlightType.GENERIC_ERROR_OR_WARNING);
                }
            }
        }

    }