Tag: XMLparsing

加载完成后,我无法得到我的xml属性在ios中的值

请帮我解决这个问题,我已经在这个问题的最后一个星期打了 我从connectionDidFinishLoading:得到服务器的XML响应connectionDidFinishLoading:我调用了xmlparsing方法的方法来获取属性值,但是它不会调用parsing器方法来获取值。 这是我从服务器获得的XML结构,我试图在xml中获取状态属性值,但是我无法完成。 <?xml version="1.0"?> <response action="registration"> <element> <properties name="username">test1@test.com</properties> <properties name="ticket"></properties> <properties name="chatNickName">test</properties> <properties name="vendorid"></properties> <properties name="currencyid">USD</properties> <properties name="status">0</properties> <properties name="errdesc"></properties> </element> </response> -(void)callWs:(id)parentView:(NSString *)soapMessage { if ([parentView isKindOfClass:[ViewController class]]) { NSLog(@"wodObj"); viewobj = (ViewController *)parentView; } responseText = [[NSString alloc] init]; NSURL *url = [NSURL URLWithString:[WSAddress getWsAddress]]; NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url]; NSString […]

获取子类Xmlparsing的attibuteDict – Swift

我想获得我的项目的子类的属性: <pdv id="1000002" latitude="4621842" longitude="522767" cp="01000" pop="R"> <adresse>16 Avenue de Marboz</adresse> <ville>BOURG-EN-BRESSE</ville> <ouverture debut="01:00" fin="01:00" saufjour=""/> <services> <service>Automate CB</service> <service>Vente de gaz domestique</service> </services> <prix nom="Gazole" id="1" maj="2015-05-30 11:30:17" valeur="1206"/> <prix nom="SP95" id="2" maj="2015-05-30 11:30:17" valeur="1398"/> <prix nom="SP98" id="6" maj="2015-05-30 11:30:17" valeur="1434"/> <rupture id="3" nom="E85" debut="2009-11-03 12:19:00" fin=""/> <fermeture/></pdv> 我知道如何用attributeDict获得<pdv id="000"> ,但我试图获得<prix nom="example"> 我试着用这个代码: func […]

XMLparsing后数据将不会加载

我是新来的iOS,我一直在尝试实现XMLparsing。 我使用由Gabriel Theodoropoulos提供的用于XMLparsing的自定义类(XMLParser)。 我正在尝试加载和保存应用程序启动时的数据。 数据也被parsing和保存,但是我试图加载保存的文件的视图之前加载,所以数据不被显示。 但是当我再次将视图推入视图时,数据是可见的。 从我所观察到的,AppDelegate中XMLParser类方法的完成发生在视图加载之后。 当我单击一个刷新button来执行相同的操作时,parsing和视图加载正常发生。 你能帮我吗? 这是我来了多远 AppDelegate.m @interface AppDelegate () @end @implementation AppDelegate – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [self initialNewsFetch]; return YES; } -(void) initialNewsFetch { //1. Main view|Home:- Most Read UIStoryboard * storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; RootViewController * mostRead = [storyboard instantiateViewControllerWithIdentifier:@"RootViewController"]; [mostRead refreshData]; [[NSNotificationCenter defaultCenter] postNotificationName:@"ArtsNewsAvailable" object:nil]; […]

Objective-C中复杂的XMLparsing

我必须阅读和显示我的书籍应用程序内的多个字符对话框。 我打算以下列格式将字符对话数据存储在XML中: <?xml version="1.0" encoding="UTF-8"?> <Pages> <Page Id="P1"> <T>Once upon a time in the deep jungle of sunderbun there lived a lazy and wicked Jackal.Once upon a time in the deep jungle of sunderbun there lived a lazy and wicked Jackal.</T> <A>This is audio file location.This is audio file location.This is audio file location.</A> <Dlg> […]

在目标c中从NSMutableArray中获取错误的ID

我是iOS新手,当我search后在我的文本框中添加search框给我错误的ID。 在我的代码中有三个数组,一个是id,另一个是名字,第三个是search。 我的代码: – (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)sections{ if(tableView == table) { if(isFilter) { return [searchArray count]; } else return [idarray count]; } } – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { if(tableView == table) { if(isFilter) { cell.textLabel.text=[NSString stringWithFormat:@"%@",[searchArray objectAtIndex:indexPath.row]]; } else { cell.textLabel.text=[NSString stringWithFormat:@"%@",[namearray objectAtIndex:indexPath.row]]; } } } – (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if(tableView […]

CData不被NSXmlparserparsing

我收到来自服务的xmlforms的响应,我使用nsxmlparser进行parsing。 在一个实例中,我收到了一个xml,其中两个标签中的内容是相同的(重复项如下面的xml) 收到的Xml: <UserGeneratedContentItem> <link rel="details" uri="http://api.test.no/test.Ugc/vivo/usergeneratedcontentitem/16046" /> <Data><![CDATA[<Type>Note</Type><Description>**6000 characters**</Description><Page>6</Page><ChapterNumber>1</ChapterNumber><ChapterTitle>Etikk og filosofi</ChapterTitle><Uri>http://api.test.no/test.Ugc/vivo/usergeneratedcontentitem/6</Uri><Data><StickyNotes><StickyNote name="icon_2" X="215.8" Y="352.7" note="**6000 characters**" dateTime="null" popupX="940" popupY="119" popupWidth="300" popupHeight="180" formatedDate ="2012-12-28-18-20-47" iconImage="1003"/></StickyNotes></Data>]]></Data> </UserGeneratedContentItem> <UserGeneratedContentItem> <link rel="details" uri="http://api.test.no/test.Ugc/vivo/usergeneratedcontentitem/16046" /> <Data><![CDATA[<Type>Note</Type><Description>**6000 characters**</Description><Page>6</Page><ChapterNumber>1</ChapterNumber><ChapterTitle>Etikk og filosofi</ChapterTitle><Uri>http://api.test.no/test.Ugc/vivo/usergeneratedcontentitem/6</Uri><Data><StickyNotes><StickyNote name="icon_2" X="215.8" Y="352.7" note="**6000 characters**" dateTime="null" popupX="940" popupY="119" popupWidth="300" popupHeight="180" formatedDate ="2012-12-28-18-20-47" iconImage="1003"/></StickyNotes></Data>]]></Data> </UserGeneratedContentItem> 6000个字符包括将被编码的字母,算术和一般标点符号。 概率: 在 – (void)分析器中:(NSXMLParser *)parsing器foundCDATA:(NSData […]

如何在目标c中创builddynamicsoap信封

SOAP Body NSString *soapMessage = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance>\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema>\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/>\">\n" "<soap:Body>\n" " <Ins_VIP xmlns=\"http://tempuri.org/>\">\n" "<strVIPNo>%@</name>\n" "</name>\n" "</soap:Body>\n" "</soap:Envelope>\n" , str]; 这是一个简单的soap消息,你知道这一点。如果我想通过使用函数来传递str的值,我如何构造它? 但是,我想通过这个对象的价值传递怎么可能?

在NSXMLParser中parsingxml

我已经阅读了很多如何从XML文件中获取文本的例子,但没有得到如何。 这是一个示例XML文件: <?xml version="1.0" encoding="UTF-8"?> <questions> <set> <question>Question</question> <answer>Answer</answer> </set> </questions> 使用-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI ,获取值的最简单方法是什么? 我已经有我的parsing器委托迷上了,所有这一切。

如何在iPhone上使用xmlparsingparsingXML文件?

如何在iPhone上使用xmlparsing访问以下XML文件? <?xml version="1.0" encoding="iso-8859-1"?> <chapter> <TITLE>Title &plainEntity;</TITLE> <para> <informaltable> <tgroup cols="3"> <tbody> <row><entry>a1</entry><entry morerows="1">b1</entry><entry>c1</entry></row> <row><entry>a2<<?xml version="1.0" encoding="iso-8859-1"?> <ADDRESS> <CONTACT> <NAME FIRST="Fred" LAST="Bloggs" NICK="Bloggsie" TITLE="Mr" /> <STREET HOME="5 Any Street" WORK="Floor 24, BigShot Tower" /> <CITY HOME="Little Town" WORK="Anycity" /> <COUNTY HOME="Anyshire" WORK="Anyshire" /> <POSTAL HOME="as plain text" WORK="text" /> <COUNTRY HOME="UK" WORK="UK" /> <PHONE HOME="as […]

使用NSXMLparsing器无法find用于XMLparsing的NSXMLDocument类

我一直在尝试使用NSXMLparsing器来parsingxml文件。 在这一点上,我想使用NSXMLDocument类来存储它的实例中的数据。 在以各种可能的方式search之后,我无法清楚地了解NSXMLDocument。 我没有特别为此input任何课程。 我必须添加任何类或lib文件?