Package org.jdom.xpath

Examples of org.jdom.xpath.XPath.selectSingleNode()


        try {
            //Extract the last 4 characters from the codeSystem param
            String tableId = codeSystem.substring(codeSystem.length() - 4);
            //System.out.println(tableId);
            XPath path = XPath.newInstance("/Specification/hl7tables/hl7table[@id='" + tableId + "']");
            table = (Element) path.selectSingleNode(tableDoc);
        } //end try
        catch (Exception e) {
            throw new ProfileException(e.toString(), e);
        } //end catch
        return table;
View Full Code Here


        URL configurl = FileLocator.LocateURL(dictionaryConfigURL, "dictionaryconfig.xml");
        org.jdom.Document document = builder.build(configurl);
       
        XPath x  = XPath.newInstance("//dictionary[@id='CF_DICTIONARY']/version[@key=\'"+ versionkey +"\']/grammar[1]");
       
        Element grammerElement    = (Element)x.selectSingleNode(document);
        dic = new SQLSyntaxDictionary();
        ((CFSyntaxDictionary)dic).loadDictionary(grammerElement.getAttributeValue("location"));
        dictionaryVersionCache.put(versionkey, dic);
      } catch (MalformedURLException e) {
        // TODO Auto-generated catch block
View Full Code Here

         return FWXImages.get(FWXImages.ICON_PROJECT);
       }
       else if(node.getFrameworkFile()!=null){
         //one final try, just get the node for the framework since this has failed
        XPath x2 = XPath.newInstance("/labels/framework[@id='"+node.getFrameworkFile().getFrameworkType() +"']/node[@name='"+ node.getFrameworkFile().getFrameworkType() + "']");
        Object object = x2.selectSingleNode(labelDocument);
        if(object != null && object instanceof Element){
          Element lblNode = (Element) object;
          String imagePath = lblNode.getAttributeValue("image");
           if(imagePath != null){
             return FWXImages.get(imagePath);
View Full Code Here

    this.frameworkDefinitionDocument = ConfigLoader.loadConfig("frameworks.xml");
   
    try {
      XPath x = XPath.newInstance("//framework[@id='"+ fwfile.getFrameworkType() +"']");
     
      Element element = (Element)x.selectSingleNode(frameworkDefinitionDocument);
     
      this.frameworkDefinitionElement = element;
     
    } catch (JDOMException e) {
      // TODO Auto-generated catch block
View Full Code Here

   * @throws CoreException
   */
  private IFile findIncludeFile(Element element) throws JDOMException, CoreException {
    //Get the path that we are meant to be seeking
    XPath x = XPath.newInstance("//framework[@id='" + this.fwfile.getFrameworkType() + "']/include[@node='"+ element.getName() + "']");
    Element includeDef = (Element)x.selectSingleNode(this.frameworkDefinitionDocument);
    String pathAttributeName = includeDef.getAttributeValue("path");
    String pathValue = element.getAttributeValue(pathAttributeName);
    String includeType = includeDef.getAttributeValue("type");
   
    if(includeType == null){
View Full Code Here

      private void openIncludeTemplate(TreeNode selNode) {
        FrameworksContentProvider contentProvider = (FrameworksContentProvider)viewer.getContentProvider();
        Document csDocument = contentProvider.getDocument(FrameworkManager.COLDSPRING);
         try {
          XPath x  = XPath.newInstance("//bean[@id='modelGlueConfiguration']/property[@name='viewMappings']/value");
          Element viewMapping    = (Element)x.selectSingleNode(csDocument);
       
          String templateFile = selNode.getElement().getAttributeValue("template")
          String pathToTemplateFile = viewMapping.getText().substring(currentProject.getName().length()+1) + "/" + templateFile;
         
         
View Full Code Here

  }
 
  public String getFrameworkId(String frameworkName){
    try {
      XPath x = XPath.newInstance("//framework[@name='"+ frameworkName+ "'");
      Element element = (Element)x.selectSingleNode(frameworksDoc);
      return element.getAttributeValue("id");
     
    } catch (JDOMException e) {
      e.printStackTrace();
    }
View Full Code Here

        Document doc = builder.build( new File( basedir, ".classpath" ) );

        XPath resourcePath = XPath.newInstance( "//classpathentry[@path='src/main/resources']" );

        assertTrue( "resources classpath entry not found.", resourcePath.selectSingleNode( doc ) != null );

        XPath testResourcePath = XPath.newInstance( "//classpathentry[@path='src/test/resources']" );

        assertTrue( "test resources (minus custom output dir) classpath entry not found.",
                    testResourcePath.selectSingleNode( doc ) != null );
View Full Code Here

        assertTrue( "resources classpath entry not found.", resourcePath.selectSingleNode( doc ) != null );

        XPath testResourcePath = XPath.newInstance( "//classpathentry[@path='src/test/resources']" );

        assertTrue( "test resources (minus custom output dir) classpath entry not found.",
                    testResourcePath.selectSingleNode( doc ) != null );

        XPath stdOutputPath = XPath.newInstance( "//classpathentry[@kind='output' && @path='target/classes']" );

        assertTrue( "standard output classpath entry not found.", stdOutputPath.selectSingleNode( doc ) != null );
View Full Code Here

        assertTrue( "test resources (minus custom output dir) classpath entry not found.",
                    testResourcePath.selectSingleNode( doc ) != null );

        XPath stdOutputPath = XPath.newInstance( "//classpathentry[@kind='output' && @path='target/classes']" );

        assertTrue( "standard output classpath entry not found.", stdOutputPath.selectSingleNode( doc ) != null );

    }

    public void testWrite_ShouldGenerateValidJavadocURLs()
        throws MojoExecutionException, JDOMException, IOException
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.