-1

DDXMLDocument を再帰的にループし、要素の属性を変更したいと考えています。

どうすればできますか?私は現在、ドキュメントとルート要素を持っています:

DDXMLDocument *theDocument = [[DDXMLDocument alloc] initWithXMLString:content options:0 error:&error];
    DDXMLElement *rootElement = theDocument.rootElement;
4

1 に答える 1

1

後置ツリー ウォークの実装:

-(void)processNode:(DDXMLNode *)node {
    if(node.kind == DDXMLElementKind) {
       //...
       for(DDXMLNode *child in node.children) {
           [self processNode:child];
       }
    }
}
于 2012-12-31T17:48:20.580 に答える