Examples of addNamespace()


Examples of org.jaxen.SimpleNamespaceContext.addNamespace()

    public void extractContent(
            Document xmlDoc, String name, String xpath, Metadata metadata) {
        try {
            JDOMXPath xp = new JDOMXPath(xpath);
            SimpleNamespaceContext context = new SimpleNamespaceContext();
            context.addNamespace("dc", "http://purl.org/dc/elements/1.1/");
            context.addNamespace("meta", "urn:oasis:names:tc:opendocument:xmlns:meta:1.0");
            xp.setNamespaceContext(context);
            List selectNodes = xp.selectNodes(xmlDoc);
            Iterator nodes = selectNodes.iterator();
            while (nodes.hasNext()) {
View Full Code Here

Examples of org.jaxen.XPath.addNamespace()

      throws JaxenException {
    DocumentNavigator nav = new DocumentNavigator();
    XPath contextpath = new BaseXPath(path, nav);
    if (namespaces != null) {
      for (Map.Entry<String, String> entry : namespaces.entrySet()) {
        contextpath.addNamespace(entry.getKey(), entry.getValue());
      }
    }
    if (functions != null) {
      contextpath.setFunctionContext(
        getFunctionContext(
View Full Code Here

Examples of org.jaxen.dom.DOMXPath.addNamespace()

    {
        DOMXPath xpath = new DOMXPath(path);
        for (Iterator itr = namespaces.entrySet().iterator(); itr.hasNext();)
        {
            Map.Entry entry = (Map.Entry) itr.next();
            xpath.addNamespace((String) entry.getKey(), (String) entry.getValue());
        }
       
        return xpath.selectNodes(node);
    }
   
View Full Code Here

Examples of org.jaxen.dom.DOMXPath.addNamespace()

  {
    try
    {
      DOMXPath xPath = new DOMXPath(nodeSelector);
      for (String prefix : resource.getNamespaceContext().keySet())
        xPath.addNamespace(prefix, resource.getNamespaceContext().get(prefix));
      Node node = (Node) xPath.selectSingleNode(resource.getDocument().getDom());
      if (node == null)
        return null;
      return new XpathXmlResource(node);
    }
View Full Code Here

Examples of org.jaxen.jdom.JDOMXPath.addNamespace()

    Document doc = builder.build(fis);
    Element root = doc.getRootElement();
    // XXX this is expensive for very large documents. In those cases another
    // XXX method (direct processing of SAX events, or XMLPull) should be used.
    XPath path = new JDOMXPath("//text:span | //text:p | //text:tab | //text:tab-stop | //text:a");
    path.addNamespace("text", root.getNamespace("text").getURI());
    Namespace xlink = Namespace.getNamespace("xlink", "http://www.w3.org/1999/xlink");
    List list = path.selectNodes(doc);
    boolean lastp = true;
    for (int i = 0; i < list.size(); i++) {
      Element el = (Element)list.get(i);
View Full Code Here

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

  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");
        Element versionElement = element.getChild("version",ns);
View Full Code Here

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

        // Get all constraints that have our URL pattern
        // (Note the crazy j: prefix to denote the 2.4 j2ee schema)
        selector = "//j:web-app/j:security-constraint[j:web-resource-collection/j:url-pattern=\"" + url + "\"]";
        xpath = XPath.newInstance( selector );
        xpath.addNamespace( "j", J2EE_SCHEMA_24_NAMESPACE );
        List<?> constraints = xpath.selectNodes( root );

        // Get all constraints that match our Role pattern
        selector = "//j:web-app/j:security-constraint[j:auth-constraint/j:role-name=\"" + role.getName() + "\"]";
        xpath = XPath.newInstance( selector );
View Full Code Here

Examples of org.jibx.ws.wsdl.model.Definitions.addNamespace()

           
            // add part definition to message (if present)
            if (rqelem != null) {
                MessagePart part = new MessagePart("part", rqelem);
                rqmsg.getParts().add(part);
                def.addNamespace(rqelem.getUri());
            }
           
            // generate output message information
            Message rsmsg = new Message(odef.getResponseMessageName(), wns);
            op.addOutputMessage(rsmsg);
View Full Code Here

Examples of org.jibx.ws.wsdl.model.Definitions.addNamespace()

           
            // add part definition to message (if present)
            if (rselem != null) {
                MessagePart part = new MessagePart("part", rselem);
                rsmsg.getParts().add(part);
                def.addNamespace(rselem.getUri());
            }
           
            // process fault message(s) for operation
            ArrayList thrws = odef.getThrows();
            WsdlCustom wsdlcustom = m_generationParameters.getWsdlCustom();
View Full Code Here

Examples of org.jibx.ws.wsdl.model.Definitions.addNamespace()

                    QName fqname = new QName(sns, fault.getElementName());
                    MessagePart part = new MessagePart("fault", fqname);
                    fmsg = new Message(fault.getFaultName(), wns);
                    fmsg.getParts().add(part);
                    def.addMessage(fmsg);
                    def.addNamespace(sns);
                   
                    // make sure the corresponding mapping exists
                    BindingMappingDetail detail = m_bindingGenerator.getMappingDetail(fault.getDataType());
                    if (detail == null) {
                        throw new IllegalStateException("No mapping found for type " + type);
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.