Package org.jdom

Examples of org.jdom.Namespace


    private XPath passwordExpression;

    public WSNormalAuthService()
            throws JDOMException
    {
        Namespace namespace = Namespace.getNamespace(WSConstants.NAMESPACE_PREFIX_CRIS,
                WSConstants.NAMESPACE_CRIS);
        usernameExpression = XPath.newInstance("//cris:Username");
        usernameExpression.addNamespace(namespace);
        passwordExpression = XPath.newInstance("//cris:Password");
        passwordExpression.addNamespace(namespace);
View Full Code Here


    protected AuthenticationWS authenticationWS;

    public AWSAuthService() throws JDOMException
    {
        Namespace namespace = Namespace.getNamespace(
                WSConstants.NAMESPACE_PREFIX_CRIS, WSConstants.NAMESPACE_CRIS);
        queryExpression = XPath.newInstance("//cris:Query");
        queryExpression.addNamespace(namespace);
        projectionExpression = XPath.newInstance("//cris:Projection");
        projectionExpression.addNamespace(namespace);
View Full Code Here

     *
     * @return
     */
    public String getBaseUrl() {
        Element onlineResource = tiledPatterns.getChild("OnlineResource"); //$NON-NLS-1$
        Namespace xlink = onlineResource.getNamespace("xlink"); //$NON-NLS-1$
        Attribute href = onlineResource.getAttribute("href", xlink); //$NON-NLS-1$       
        String baseUrl = href.getValue();
       
        return baseUrl;
    }
View Full Code Here

    return output;
  }
 
  private Document createXml(File file) throws FitsToolException {
   
    Namespace xsiNS = Namespace.getNamespace("xsi","http://www.w3.org/2001/XMLSchema-instance");
    Namespace fitsNS = Namespace.getNamespace(Fits.XML_NAMESPACE);
   
    Element root = new Element("fits",fitsNS);
    root.setAttribute(new Attribute("schemaLocation","http://hul.harvard.edu/ois/xml/ns/fits/fits_output "+Fits.externalOutputSchema,xsiNS));
    //fileinfo section
    Element fileInfo = new Element("fileinfo",fitsNS);
View Full Code Here

 
  public List<ToolIdentity> createFileIdentities(Document dom, ToolInfo info) {
    List<ToolIdentity> identities = new ArrayList<ToolIdentity>();
    try {
      XPath xpath = XPath.newInstance("//fits:identity");
      Namespace ns = Namespace.getNamespace("fits",Fits.XML_NAMESPACE);
      xpath.addNamespace(ns);
      List<Element> identElements = xpath.selectNodes(dom);
      for(Element element : identElements) {
        Attribute formatAttr = element.getAttribute("format");
        Attribute mimetypeAttr = element.getAttribute("mimetype");
View Full Code Here

        return null;
    }
   
    public void addStandardCombinedFormat() throws XMLStreamException, IOException, FitsException {
    //get the normal fits xml output
    Namespace ns = Namespace.getNamespace(Fits.XML_NAMESPACE);
   
    Element metadata = (Element) fitsXml.getRootElement().getChild("metadata",ns);
    Element techmd = null;
    if(metadata.getChildren().size() > 0) {
      techmd = (Element) metadata.getChildren().get(0);
View Full Code Here

  @SuppressWarnings("unchecked")
  public List<FitsIdentity> getIdentities() {
    List<FitsIdentity> identities = new ArrayList<FitsIdentity>();
    try {
      XPath xpath = XPath.newInstance("//fits:identity");
      Namespace ns = Namespace.getNamespace("fits",Fits.XML_NAMESPACE);
      xpath.addNamespace(ns);
      List<Element> identElements = xpath.selectNodes(fitsXml);
      for(Element element : identElements) {
        FitsIdentity fileIdentSect = new FitsIdentity();
       
View Full Code Here

     
    //start building the FITS xml document
    Document mergedDoc = new Document();
    Element fits = new Element("fits",fitsNS);

    Namespace xsiNS = Namespace.getNamespace("xsi","http://www.w3.org/2001/XMLSchema-instance");   
    fits.addNamespaceDeclaration(xsiNS);
    fits.setAttribute(new Attribute("schemaLocation",Fits.XML_NAMESPACE+" "+Fits.externalOutputSchema, xsiNS));
   
    fits.setAttribute("version", FitsOutput.VERSION);
    DateFormat dateFormat = new SimpleDateFormat();
View Full Code Here

    return output;
  }
 
  private Document createXml(File file) throws FitsToolException {

    Namespace xsiNS = Namespace.getNamespace("xsi","http://www.w3.org/2001/XMLSchema-instance");
    Namespace fitsNS = Namespace.getNamespace(Fits.XML_NAMESPACE);
   
    Element root = new Element("fits",fitsNS);
    root.setAttribute(new Attribute("schemaLocation","http://hul.harvard.edu/ois/xml/ns/fits/fits_output "+Fits.externalOutputSchema,xsiNS));
    //If the file is XML then parse and set text metadata
    if(file.getPath().toLowerCase().endsWith(".xml")) {
      Element metadata = new Element("metadata",fitsNS);
      Element textMetadata = new Element("text",fitsNS);
     
      Document xml = null;
      try {
        saxBuilder.setFeature("http://apache.org/xml/features/validation/schema",false);
        saxBuilder.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
        xml = saxBuilder.build(file);
      } catch (Exception e) {
        throw new FitsToolException("Error parsing "+file.getPath(),e);
      }
      if(xml != null) {
        //assume we have at least well formed XML
        Element identification = new Element("identification",fitsNS);
        Element identity = new Element("identity",fitsNS);
        identity.setAttribute("format",XML_FORMAT);
        identity.setAttribute("mimetype",XML_MIME);
        //add identity to identification section
        identification.addContent(identity);
        //add identification section to root
        root.addContent(identification);
               
        Element xmlRoot = xml.getRootElement();         
        String defaultNamespaceURI = xmlRoot.getNamespaceURI();
        List<Namespace> namespaces = xmlRoot.getAdditionalNamespaces();
        String schemaPrefix = null;
        for(Namespace n : namespaces) {
          if(n.getURI().equalsIgnoreCase(XML_SCHEMA_INSTANCE)) {
            schemaPrefix = n.getPrefix();
            break;
          }
        }
       
        Namespace schemaNS = xmlRoot.getNamespace(schemaPrefix);
        String schemaLocations = null;
        String noNamespaceSchemaLocation = null;
        if(schemaNS != null) {
          schemaLocations = xmlRoot.getAttributeValue("schemaLocation",schemaNS);
          noNamespaceSchemaLocation = xmlRoot.getAttributeValue("noNamespaceSchemaLocation",schemaNS);
View Full Code Here

            }
        }
    }

    public JobConf createBaseHadoopConf(Context context, Element actionXml) {
        Namespace ns = actionXml.getNamespace();
        String jobTracker = actionXml.getChild("job-tracker", ns).getTextTrim();
        String nameNode = actionXml.getChild("name-node", ns).getTextTrim();
        JobConf conf = Services.get().get(HadoopAccessorService.class).createJobConf(jobTracker);
        conf.set(HADOOP_USER, context.getProtoActionConf().get(WorkflowAppService.HADOOP_USER));
        conf.set(HADOOP_JOB_TRACKER, jobTracker);
View Full Code Here

TOP

Related Classes of org.jdom.Namespace

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.