Package org.jdom.filter

Examples of org.jdom.filter.ElementFilter


      try {
          // Load bbox info for later use (eg. WMS thumbnails creation)
          Namespace gmd   = Namespace.getNamespace("http://www.isotc211.org/2005/gmd");
          Namespace gco   = Namespace.getNamespace("http://www.isotc211.org/2005/gco");
         
          ElementFilter bboxFinder = new ElementFilter("EX_GeographicBoundingBox", gmd);
                @SuppressWarnings("unchecked")
                Iterator<Element> bboxes = xml.getDescendants(bboxFinder);
         
          while (bboxes.hasNext()) {
            Element box = bboxes.next();
View Full Code Here


     * @return
    */
  private boolean isMatchingAttributeInMetadata(Attribute needle, Element haystack) {
    boolean returnVal = false;
    @SuppressWarnings("unchecked")
        Iterator<Element> haystackIterator = haystack.getDescendants(new ElementFilter());

        if(Log.isDebugEnabled(Geonet.SCHEMA_MANAGER))
            Log.debug(Geonet.SCHEMA_MANAGER, "Matching " + needle.toString());

    while(haystackIterator.hasNext()){
View Full Code Here

            Log.debug(Geonet.SCHEMA_MANAGER, "Matching " + needle.toString());

    if (checkNamespacesOnElement(needle,haystack)) return true;

    @SuppressWarnings("unchecked")
        Iterator<Element> haystackIterator = haystack.getDescendants(new ElementFilter());
    while(haystackIterator.hasNext()){
      Element tempElement = haystackIterator.next();
      if (checkNamespacesOnElement(needle,tempElement)) return true;
    }
    
View Full Code Here

     * @return
    */
  private boolean isMatchingElementInMetadata(Element needle, Element haystack, boolean checkValue) {
    boolean returnVal = false;
    @SuppressWarnings("unchecked")
        Iterator<Element> haystackIterator = haystack.getDescendants(new ElementFilter());
   
    String needleName = needle.getName();
    Namespace needleNS = needle.getNamespace();
        if(Log.isDebugEnabled(Geonet.SCHEMA_MANAGER))
            Log.debug(Geonet.SCHEMA_MANAGER, "Matching " + Xml.getString(needle));
View Full Code Here

     * @return
     */
  public int findMaximumRef(Element md) {
    int iRef = 0;
    @SuppressWarnings("unchecked")
        Iterator<Element> mdIt = md.getDescendants(new ElementFilter("element"));
    while (mdIt.hasNext()) {
      Element elem = mdIt.next();
      String ref = elem.getAttributeValue("ref");
      if (ref != null) {
        int i = Integer.parseInt(ref);
View Full Code Here

    Element result = null;
    if (parent != null) {
      int me = parent.indexOf(el);

      //--- check and see whether the element to be deleted is the last one of its kind
      Filter elFilter = new ElementFilter(uName,ns);
      if (parent.getContent(elFilter).size() == 1) {

        //--- get geonet child element with attribute name = unqualified name
        Filter chFilter = new ElementFilter(Edit.RootChild.CHILD, Edit.NAMESPACE);
        @SuppressWarnings("unchecked")
                List<Element> children = parent.getContent(chFilter);

        for (Element ch : children) {
          String name = ch.getAttributeValue("name");
View Full Code Here

     * </code></pre>
     *
     * @param errorReport
     */
    static void restructureReportToHavePatternRuleHierarchy(Element errorReport) {
        final Iterator patternFilter = errorReport.getDescendants(new ElementFilter(EL_ACTIVE_PATTERN, Geonet.Namespaces.SVRL));
        @SuppressWarnings("unchecked")
        List<Element> patterns = Lists.newArrayList(patternFilter);
        for (Element pattern : patterns) {
            final Element parentElement = pattern.getParentElement();
            Element currentRule = null;
View Full Code Here

                    Element xmlReport = Xml.transform(md, schemaTronXmlXslt, params);
                    if (xmlReport != null) {
                        report.addContent(xmlReport);
                        // add results to persitent validation information
                        int firedRules = 0;
                        Iterator<?> firedRulesElems = xmlReport.getDescendants(new ElementFilter ("fired-rule", Namespaces.SVRL));
                        while (firedRulesElems.hasNext()) {
                            firedRulesElems.next();
                            firedRules ++;
                        }
                        int invalidRules = 0;
                        Iterator<?> faileAssertElements = xmlReport.getDescendants(new ElementFilter ("failed-assert",
                                Namespaces.SVRL));
                        while (faileAssertElements.hasNext()) {
                            faileAssertElements.next();
                            invalidRules ++;
                        }
View Full Code Here

                        if (xmlReport != null) {
                            report.addContent(xmlReport);
                            // add results to persistent validation information
                            int firedRules = 0;
                            @SuppressWarnings("unchecked")
                            Iterator<Element> i = xmlReport.getDescendants(new ElementFilter ("fired-rule", Namespaces.SVRL));
                            while (i.hasNext()) {
                                i.next();
                                firedRules ++;
                            }
                            int invalidRules = 0;
                            i = xmlReport.getDescendants(new ElementFilter ("failed-assert", Namespaces.SVRL));
                            while (i.hasNext()) {
                                i.next();
                                invalidRules ++;
                            }
                            Integer[] results = {invalidRules!=0?ifNotValid:1, firedRules, invalidRules};
View Full Code Here

///////////////////////////////////////////////////////////////////////////////////////////////////////

    public static String[] parsePackagePath(final Element element) {
        SortedSet<Element> packagePathElementSortedSet = new TreeSet<Element>(JdomTreePositionComparator.getInstance());

        for (Iterator iterator = element.getDescendants(new ElementFilter(JavaSourceTokenType.IDENT.getName()));
             iterator.hasNext(); ) {
            packagePathElementSortedSet.add((Element) iterator.next());

        }
View Full Code Here

TOP

Related Classes of org.jdom.filter.ElementFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.