URLのxmlを解析するためにNSXMLParserを使用しています。一部の要素には、テキストに特殊文字と斜体が含まれています。
- テキストにイタリック体のタグが付いた以下の xml 要素を見つけてください。
<name>Verify Settings<i>i</i>patch level</name>
NSXMLParser はテキストを分割し、出力を提供します:設定の確認
要素間の斜体テキストを解析する方法はありますか?
- 以下の特殊文字を含む xml を見つけてください。
<impact> In 2003, the ¿shared APPL_TOP¿ architecture was introduced, which allowed the sharing of a single APPL_TOP, however the tech stack · Reduced disk space requirements · Reduced maintenance · Reduced administrative costs · Reduced patching down time · Less complex to add additional nodes, making scalability easier · Complexity of instance reduced · Easier backups · Easier cloning</impact>
テキストを分割して出力: e コスト ·パッチ適用のダウンタイムを短縮 ·ノードを追加する複雑さが軽減され、スケーラビリティが容易になる ·インスタンスの複雑さが軽減される ·バックアップが容易になる ·クローン作成が容易になる
NSXMLParser を使用して、テキスト内の斜体タグと特殊文字を解析する方法に関する提案はありますか?
これが私のfoundCharacters
コードです:
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
{
if (!self.currentStringValue) {
// currentStringValue is an NSMutableString instance variable
self.currentStringValue = [[NSMutableString alloc] init];
}
[self.currentStringValue appendString:string];
}