Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Common Public License 

import org.w3c.dom.Element;

public class Main {
    public static final String DITA_FORMAT_ATTNAME = "format";

    /**
     * Returns true if the topicref specifies format="ditamap"
     * @param topicref
     * @return
     */
    public static boolean targetIsADitaMap(Element topicref) {
        if (topicref.hasAttribute(DITA_FORMAT_ATTNAME)) {
            String formatValue = topicref.getAttribute(DITA_FORMAT_ATTNAME);
            if ("ditamap".equalsIgnoreCase(formatValue))
                return true;
        }
        return false;
    }
}