你用什么解析的~?怎么解析的?
CDATA只表示中间是一段完整的片段,不受一些特殊符号的影响,没别的作用,直接获取description的值应该就可以了

解决方案 »

  1.   

    用DOM解析的的 取description值是空的 根本取不到
      

  2.   

    public   static   void   main(String[]   args)   throws   Exception   {   
            DocumentBuilderFactory   dbf   =   DocumentBuilderFactory.newInstance();   
            DocumentBuilder   db   =   dbf.newDocumentBuilder();   
            Document   doc   =   db.parse(new   FileInputStream("C:\\Documents and Settings\\Administrator\\桌面\\q.xml"));   
            Element   e   =   doc.getDocumentElement();   
            NodeList   nl   =   e.getChildNodes();   
            for   (int   i   =   0;   i   <   nl.getLength();   i++)   {   
                    Node   n   =   nl.item(i);   
                    if   (n.getNodeType()   ==   Node.CDATA_SECTION_NODE)   {   
                            System.out.println(n.getNodeValue());   
                    }   
            }   
    }   
      

  3.   

    你这么获取只是获取最上一级的...
    你得通过getChildNodes去获取子节点
      

  4.   


        public  static  void  main(String[]  args)  throws  Exception  {  
            DocumentBuilderFactory  dbf  =  DocumentBuilderFactory.newInstance();  
            DocumentBuilder  db  =  dbf.newDocumentBuilder();  
            Document  doc  =  db.parse(new  FileInputStream("C:\\q.xml"));  
            Element  e  =  doc.getDocumentElement();  
            printChildNodes(e.getChildNodes());
        } 

    public static void printChildNodes(NodeList list) {
    for  (int  i  =  0;  i  <  list.getLength();  i++)  {  
             Node  n  =  list.item(i);  
             System.out.println(n.getNodeName() + " : " + n.getNodeValue());
             printChildNodes(n.getChildNodes());
            }  
    }
      

  5.   

    看看孙鑫的xml教学视频,讲的很详细的
      

  6.   

    http://jykenan.iteye.com/blog/1251674看可能这个链接,如果你的里面只是这样一段话的好,那这个链接你看了就知道了。