Package org.jdom2

Examples of org.jdom2.Content


    if(!sense.equals(sense2))
    {
      qry+="+AND+"+"\""+sense2.getSid()+"\"";
    }
    URL count=new URL(this.path+"/w/index.php?title=Special%3ASearch&profile=default&search="+qry+"&fulltext=Search");   
    Document xml=this.loadURL(count)
    if(xml!=null)
    {
      String aux="mw-search-formheader";
      for(Element e:this.getContentNode(xml).getDescendants(new ElementFilter("div")))
      {
View Full Code Here


        System.out.println("-----------Checking file: "+file.getName()+ " "+String.valueOf(x)+"/"+String.valueOf(files.size())+"--------------");
        x++;
        try
        {
          SAXBuilder builder=new SAXBuilder();
          Document xml=(Document)builder.build(file);
          ArrayList<Element> words=new ArrayList<Element>();
          for(Element word:xml.getDescendants(new ElementFilter("wf")))
            words.add(word);
          for(int w=0;w<words.size();w++)
          {
            Element word=words.get(w);
            if(word.getAttribute("ot")!=null)
View Full Code Here

     * @throws IOException
     */
    private Element htmlStringToElement( String html ) throws JDOMException, IOException
    {
        SAXBuilder builder = new SAXBuilder( CYBERNEKO_PARSER, true );
        Document doc = builder.build( new StringReader( html ) );
        Element element = doc.getRootElement();
        return element;
    }
View Full Code Here

     @param element The element to get HTML from.
     *  @return HTML
     */
    public static String element2String( Element element )
    {
        Document document = new Document( element );
        XMLOutputter outputter = new XMLOutputter();
        return outputter.outputString( document );
    }
View Full Code Here

    }

    @Override
    protected void testArgument(Object argument, MethodParameter parameter) {
        assertTrue("argument not a element", argument instanceof Element);
        Element node = (Element) argument;
        assertEquals("Invalid namespace", NAMESPACE_URI, node.getNamespaceURI());
        assertEquals("Invalid local name", LOCAL_NAME, node.getName());
    }
View Full Code Here

        assertEquals("Invalid local name", LOCAL_NAME, node.getName());
    }

    @Override
    protected Element getReturnValue(MethodParameter returnType) {
        return new Element(LOCAL_NAME, NAMESPACE_URI);
    }
View Full Code Here

            @Override
            protected Element invokeInternal(Element requestElement) throws Exception {
                assertNotNull("No requestElement passed", requestElement);
                assertEquals("Invalid request element", REQUEST_ELEMENT, requestElement.getName());
                assertEquals("Invalid request element", NAMESPACE_URI, requestElement.getNamespaceURI());
                return new Element(RESPONSE_ELEMENT, Namespace.getNamespace("tns", NAMESPACE_URI));
            }
        };
    }
View Full Code Here

        return supports(returnType);
    }

    @Override
    protected Source createResponsePayload(MethodParameter returnType, Object returnValue) {
        Element returnedElement = (Element) returnValue;
        return new JDOMSource(returnedElement);
    }
View Full Code Here

        this.alwaysTransform = alwaysTransform;
    }

    @Override
    public final Source invoke(Source request) throws Exception {
        Element requestElement = getDocumentElement(request);
        Element responseElement = invokeInternal(requestElement);
        return responseElement != null ? new JDOMSource(responseElement) : null;
    }
View Full Code Here

        } else if(variable.contentEquals("LastChange")){
          
            SAXBuilder sxb = new SAXBuilder();
            try {
                Document document = sxb.build(new InputSource(new StringReader(value)));
                Element root = document.getRootElement();
                List<Element> children = root.getChildren();
                Iterator<Element> iterator = children.iterator();
                while (iterator.hasNext()) { //for each instanceID
                    Element current = iterator.next();
                    List<Element> childList = current.getChildren();
                    Iterator<Element> iterChild = childList.iterator();
                    Element child;
                    while (iterChild.hasNext()) {
                        child = iterChild.next();
                        String attributeValue = child.getAttributeValue("val");
//                        if (child.getName().equalsIgnoreCase("Volume")) {
//                            if (child.getAttributeValue("channel").equalsIgnoreCase("Master")) {
//                                volume = attributeValue;
//                            }
//                        } else if (child.getName().equalsIgnoreCase("Mute")) {
//                            muteState = Boolean.valueOf(attributeValue);
//                        } else if (child.getName().equalsIgnoreCase("PresetName")) {
//                            currentPreset = attributeValue;
//                        } else if (child.getName().equalsIgnoreCase("CurrentTrackDuration")) {
//                            trackDuration = attributeValue;
//                        } else if (child.getName().equalsIgnoreCase("AVTransportURI")) {
//                            String[] split = attributeValue.split("/");
//                            title = split[split.length - 1];
/*                        } else*/ if (child.getName().equalsIgnoreCase("TransportState")) {
                            if (attributeValue.contentEquals("STOPPED")) {
                                update.offer("device" + UDN + "/value/" + "renderer_stop.png");
                            } else if (attributeValue.contentEquals("PAUSED_PLAYBACK")) {
                                update.offer("device" + UDN + "/value/" + "renderer_pause.png");
                            } else if (attributeValue.contentEquals("PLAYING")) {
View Full Code Here

TOP

Related Classes of org.jdom2.Content

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.