我对编码非常陌生,尝试将JDBC查询的结果与XML响应中的结果进行比较时遇到麻烦。
我使用发现的各种示例来构建脚本,因为我找不到一个可以完成我想要的示例。
示例JDBC响应
<Results>
<ResultSet fetchSize="128">
<Row rowNumber="1">
<CATEGORYID>3</CATEGORYID>
<PARENTID>2</PARENTID>
<NAME>TEST1</NAME>
<THUMBNAIL/>
<PRIORITY>1</PRIORITY>
<LEVEL>1</LEVEL>
</Row>
<Row rowNumber="2">
<CATEGORYID>4</CATEGORYID>
<PARENTID>2</PARENTID>
<NAME>Cool</NAME>
<THUMBNAIL/>
<PRIORITY>12</PRIORITY>
<LEVEL>1</LEVEL>
</Row>
<Row rowNumber="3">
<CATEGORYID>6</CATEGORYID>
<PARENTID>2</PARENTID>
<NAME>Tool</NAME>
<THUMBNAIL/>
<PRIORITY>2</PRIORITY>
<LEVEL>1</LEVEL>
</Row>
<Row rowNumber="4">
<CATEGORYID>9</CATEGORYID>
<PARENTID>2</PARENTID>
<NAME>CCTEST</NAME>
<THUMBNAIL/>
<PRIORITY>5</PRIORITY>
<LEVEL>1</LEVEL>
</Row>
示例XML响应
<Response>
<e>
<categoryId>3</categoryId>
<name>Access</name>
<priority>1</priority>
<thumbnail/>
<level>1</level>
<subCategories>
<e>
<categoryId>36</categoryId>
<parentCategoryId>3</parentCategoryId>
<name>Test</name>
<priority>3</priority>
<thumbnail>https://CCCC.com.jpg</thumbnail>
<level>2</level>
</e>
<e>
<categoryId>37</categoryId>
<parentCategoryId>3</parentCategoryId>
<name>Lift_test</name>
<priority>4</priority>
<thumbnail>https://CCCCCCCC.com.jpg</thumbnail>
<level>2</level>
</e>
<e>
<categoryId>38</categoryId>
<parentCategoryId>3</parentCategoryId>
<name>Platform Test</name>
<priority>2</priority>
<thumbnail>https://CCCCDDDD.com.jpg</thumbnail>
<level>2</level>
</e>
<e>
我在XML响应方面遇到的问题是,每个类别都有多个子类别。我必须在父级和子级都进行验证。