English 中文(简体)
SAX parser issue
原标题:SAX parser issue

我正在研制一个RSS供暖器,用于一个特定的RSS供暖器,我与SAX和tag有问题。 各方对此视而不见。

<description>
<![CDATA[<img src=http://www.lamaruniversitypress.com/polopoly_fs/1.1832584!image/2678128836.jpg_gen/thumbnails/100x100/2678128836.jpg><br /><br><p>
    South Korea vowed Wednesday to completely punish North Korea if it attacks again.
...</p>]]>
</description>

我的开端方法有这一要素来处理描述的主角。

if (localName.equals("description"))
        {            
            currentstate = RSS_DESCRIPTION;
            return;
        }

我的果园方法就是这样:

case RSS_DESCRIPTION:
            _item.setDescription(theString);
            Log.i("DESCRIPTION","characters[" + theString + "]");
            currentstate = 0;
            break;

记录显示:

12-22 11:21:06.517: INFO/TITLE(489): characters[SKorea holds massive new drills after North attack]
12-22 11:21:06.527: INFO/DESCRIPTION(489): characters[
12-22 11:21:06.527: INFO/DESCRIPTION(489): ]

这是我第一次试图与塞拉利昂再次解放联盟合作,我正非常接近于与一位不同教区重写整件事,请你说谎是我的最后一次 d。

我已尝试处理这一段落,这并不奏效,这大概是因为它属于《美洲贸易协定》的范围之内。 我曾试图说明这种描述。

String theString = new String(ch,start,length);
        /*
        if ( currentstate == RSS_DESCRIPTION){
            theString = new String(ch, theString.indexOf("<p>") + 3, theString.indexOf("</p>"));

        }

而该方案在击中时刚刚停止。

Thanks in advance for any help!!! -David

问题回答

页: 1 计算方法 当第一个金字塔悬挂国旗时,即将到来的果园以同样的方式处理。

您可以将焦炭阵列附在<代码>StringBuilder上,然后在任何<代码>startElement、endElement 处理Instruction上。

您没有解释如何制定<代码>ch,因此很难知道什么。 这里是我受过教育的猜测:

很多(如果不是全部的话)的SAX教区会将特性数据分解成单独的活动,如果像实体参考资料或CDATA科这样的内容出现在其中的话。 它只想从一次活动中处理案文。 你们想要把他们聚集在一起。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签