0

Objective-C で XML 解析にフィルタを設定するにはどうすればよいですか?

これは私のXMLファイルです:

<shelters>
    <point id="1" lat="56.854643730" lon="9.476729748" sted="Jenle Plantage" postnr="0000" type="shelter" shelters="-" fire="Ja" wc="Nej" vand="Nej" pay="-" pafstand="-" note="Jenle Plantage" adr="Jenle Plantage" pic="nopic.png" />
    <point id="2" lat="55.253090091" lon="14.745165263" sted="Lejrplads Finnedalen" postnr="0000" type="shelter" shelters="-" fire="Ja" wc="Nej" vand="Nej" pay="-" pafstand="-" note="Lejrplads Finnedalen" adr="Lejrplads Finnedalen" pic="nopic.png" />
    <point id="3" lat="56.117966990" lon="9.463753344" sted="Løgager" postnr="0000" type="shelter" shelters="-" fire="Ja" wc="Nej" vand="Nej" pay="-" pafstand="-" note="Løgager" adr="Løgager" pic="nopic.png" />
    <point id="4" lat="55.028931084" lon="9.388940781" sted="Aabenraaskovene, Sønderskoven, Von Bergens Plads" postnr="0000" type="shelter" shelters="-" fire="Ja" wc="Nej" vand="Nej" pay="-" pafstand="-" note="Aabenraaskovene, Sønderskoven, Von Bergens Plads" adr="Aabenraaskovene, Sønderskoven, Von Bergens Plads" pic="nopic.png" />
    <point id="5" lat="56.126911668" lon="9.625711711" sted="Østre Gåsekær" postnr="0000" type="shelter" shelters="-" fire="Ja" wc="Nej" vand="Nej" pay="-" pafstand="-" note="Østre Gåsekær" adr="Østre Gåsekær" pic="nopic.png" />
</shelters>

そして、これは私の解析セクションです:

NSURL *baseURL = [NSURL fileURLWithPath:[[NSBundle mainBundle]pathForResource:@"shelters" ofType:@"xml"]];
    NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:baseURL];

    [parser setDelegate:self.parserobj];

    BOOL success = [parser parse];

    if(success)
        NSLog(@"No Errors");
    else
        NSLog(@"Error Error Error!!!");

    [self.mapView addAnnotations:self.parserobj->annotations];
    self.isCurrentCoordinatesSet = false;
    [self.mapView setDelegate:self];

私はアイテムを手に入れたいだけです

fire="Ja"
4

1 に答える 1