Package org.jdom.xpath

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


    private List getMatches(Object doc, String xpath)
    {
        try
        {
            XPath path = XPath.newInstance(xpath);
            path.addNamespace("xsd", SoapConstants.XSD);
            path.addNamespace("s", SoapConstants.XSD);
            List result = path.selectNodes(doc);
            return result;
        }
        catch (JDOMException e)
View Full Code Here


    {
        try
        {
            XPath path = XPath.newInstance(xpath);
            path.addNamespace("xsd", SoapConstants.XSD);
            path.addNamespace("s", SoapConstants.XSD);
            List result = path.selectNodes(doc);
            return result;
        }
        catch (JDOMException e)
        {
View Full Code Here

    //--------------------------------------------------------------
   
    try
    {
      XPath xpath           = XPath.newInstance("/descendant::text:index-body[1]");
      xpath.addNamespace(officeNs);
      xpath.addNamespace(textNs);
     
      Object temp            = xpath.selectSingleNode(doc);
     
      if (temp != null)
View Full Code Here

   
    try
    {
      XPath xpath           = XPath.newInstance("/descendant::text:index-body[1]");
      xpath.addNamespace(officeNs);
      xpath.addNamespace(textNs);
     
      Object temp            = xpath.selectSingleNode(doc);
     
      if (temp != null)
      {
View Full Code Here

            try
            {
                // Use a special namespace with known prefix
                // so we get the right prefix.
                XPath xpath = XPath.newInstance("descendant::mets:mdRef");
                xpath.addNamespace(metsNS);
                mdFiles = xpath.selectNodes(mets);
            }
            catch (JDOMException je)
            {
                throw new MetadataValidationException("Failed while searching for mdRef elements in manifest: ", je);
View Full Code Here

        try
        {
            XPath xpath = XPath.newInstance(
"mets:fileSec/mets:fileGrp[@USE=\"CONTENT\"]/mets:file[@GROUPID=\""+groupID+"\"]");
            xpath.addNamespace(metsNS);
            List oFiles = xpath.selectNodes(mets);
            if (oFiles.size() > 0)
            {
                if (log.isDebugEnabled())
                {
View Full Code Here

        throws MetadataValidationException
    {
        try
        {
            XPath xpath = XPath.newInstance(path);
            xpath.addNamespace(metsNS);
            xpath.addNamespace(xlinkNS);
            Object result = xpath.selectSingleNode(mets);
            if (result == null && nullOk)
            {
                return null;
View Full Code Here

    {
        try
        {
            XPath xpath = XPath.newInstance(path);
            xpath.addNamespace(metsNS);
            xpath.addNamespace(xlinkNS);
            Object result = xpath.selectSingleNode(mets);
            if (result == null && nullOk)
            {
                return null;
            }
View Full Code Here

        XPath xpathLinks;
        List<Element> aggregatedResources;
        String entryId;
    try {
      xpathLinks = XPath.newInstance("/atom:entry/atom:link[@rel=\"" + ORE_NS.getURI()+"aggregates" + "\"]");
      xpathLinks.addNamespace(ATOM_NS);
          aggregatedResources = xpathLinks.selectNodes(doc);
         
          xpathLinks = XPath.newInstance("/atom:entry/atom:link[@rel='alternate']/@href");
          xpathLinks.addNamespace(ATOM_NS);
          entryId = ((Attribute)xpathLinks.selectSingleNode(doc)).getValue();
View Full Code Here

      xpathLinks = XPath.newInstance("/atom:entry/atom:link[@rel=\"" + ORE_NS.getURI()+"aggregates" + "\"]");
      xpathLinks.addNamespace(ATOM_NS);
          aggregatedResources = xpathLinks.selectNodes(doc);
         
          xpathLinks = XPath.newInstance("/atom:entry/atom:link[@rel='alternate']/@href");
          xpathLinks.addNamespace(ATOM_NS);
          entryId = ((Attribute)xpathLinks.selectSingleNode(doc)).getValue();
    } catch (JDOMException e) {
      throw new CrosswalkException("JDOM exception occured while ingesting the ORE", e);
    }
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.