如何解析JIRA Feed XML

时间:2014-08-22 06:58:21

标签: xml parsing jira

我可以从JIRA获取XML格式的Feed。

某些字段采用表格格式。有没有办法解析这个表格格式的字段。

这是我作为JIRA Feed收到的xml文件:

    <!--  RSS generated by JIRA (6.2.3#6260-sha1:63ef1d6dac3f4db4c1effd408ccdc558) at Fri Aug 22 11:49:04 IST 2014 -->
    <?xml-stylesheet href="http://localhost:8080/styles/jirarss2html.xsl" type="text/xsl"?><rss version="2.0">    
    <channel>      
    <title>Demo</title>        
    <link>http://localhost:8080/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=</link>     
    <description>An XML representation of a search request</description>'#$A'                
    <language>en-us</language>      
    <issue start="0" end="4" total="4"/>     
    <build-info>            
    <version>6.2.3</version>            
    <build-number>6260</build-number>      
    <build-date>15-04-2014</build-date>      
    </build-info>'#$A'
    <item>   
    <title>[W-4] First Issue</title>
    <link>http://localhost:8080/browse/W-4</link>'#$A'    
    <description>
    &lt;style type=&quot;text/css&quot;&gt;'#$A#$A'.tableBorder, .grid'#$A'{'#$A'    background-color: #fff;'#$A'    width: 100%;'#$A'    border-collapse: collapse;'#$A'}'#$A#$A'.tableBorder td, .grid td'#$A'{'#$A'    vertical-align: top;'#$A'    padding: 2px;'#$A'    border: 1px solid #ccc;'#$A'}'#$A#$A'.noPadding'#$A'{'#$A'    padding: 0 !important;'#$A'}'#$A#$A'h3 .subText'#$A'{'#$A'    font-size: 60%;'#$A'    font-weight: normal;'#$A'}'#$A#$A'.tabLabel'#$A'{'#$A'    font-weight: bold;'#$A'    border: 1px solid #ccc;'#$A'    border-bottom:none;'#$A'    padding: 2px;'#$A'    display: inline;'#$A'}'#$A#$A'td.blank'#$A'{'#$A'    padding: 0;'#$A'    margin: 0;'#$A'}'#$A#$A'.blank td'#$A'{'#$A'    border: none;'#$A'}'#$A#$A'#descriptionArea'#$A'{'#$A'    margin: 0;'#$A'    padding: 2px;'#$A'    border: 1px solid #ccc;'#$A'}'#$A#$A'hr'#$A'{'#$A'    border-top:1px solid #aaa;'#$A'}'#$A#$A'hr.fullcontent'#$A'{'#$A'  height: 15px;'#$A'  padding: 10px 0;'#$A'  background: #fff url(&apos;http://localhost:8080/images/icons/hr.gif&apos;) no-repeat scroll center;'#$A'}'#$A#$A'&lt;/style&gt;'#$A' '#$A'&lt;table class=&quot;tableBorder&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot;&gt;'#$A'&lt;/style&gt
<table class="tableBorder" cellpadding="0" cellspacing="0" border="0" width="100%">'#$A'    <tr>'#$A'        <td bgcolor="#f0f0f0" width="100%" colspan="2" valign="top">'#$A'                            <h3 class="formtitle">
'#$A'                        [W-4]&nbsp;<a href="http://localhost:8080/browse/W-4">First Issue</a>'#$A'        
    <span class="subText">'#$A'               Created: 22/Aug/14                   &nbsp;Updated: 22/Aug/14'#$A#$A'                                            </span>'#$A'            </h3>'#$A'        </td>'#$A'    </tr>'#$A'   
 <tr>'#$A'       
 <td width="20%"><b>Status:</b></td>'#$A'       
 <td width="80%">To Do</td>'#$A'    </tr>'#$A'    <tr>'#$A'        <td width="20%"><b>Project:</b></td>'#$A'        <td width="80%"><a href="http://192.168.7.167:8080/secure/BrowseProject.jspa?id=10000">WO_Traffic</a></td>'#$A'    </tr>'#$A#$A'      
  <tr>'#$A'            <td><b>Component/s:</b></td>'#$A'            <td>'#$A'                            None'#$A'                </td>'#$A'    </tr>'#$A'    '#$A#$A'        <tr>'#$A'            <td><b>Affects Version/s:</b></td>'#$A'            <td>'#$A'                            None'#$A'                </td>'#$A'   
 </tr>'#$A'    '#$A#$A'        <tr>'#$A'            <td><b>Fix Version/s:</b></td>'#$A'            <td>'#$A'                            None'#$A'                </td>'#$A'    </tr>'#$A'    '#$A'    </table>
    </description>

and so on...

在此我能够得到像1. Title 2.link。

这样的字段

但在<Description>标记后,所有内容都像Html表格格式。有没有办法解析这个?

0 个答案:

没有答案