Hi all i am trying to use xpathQuery for the below xml data.
My xml file starts with assessmentItem. There is not even single character before assessmentItem
<assessmentItem adaptive="false" identifier="wordsearch" timeDependent="false" title="Word Search" xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p1
http://www.imsglobal.org/xsd/imsqti_v2p1.xsd"
xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<itemBody>
<div id="heading">
<p><![CDATA[<TextFlow columnCount="inherit" columnGap="inherit" columnWidth="inherit" fontFamily="Verdana" fontSize="9" lineBreak="inherit" paddingBottom="inherit" paddingLeft="2" paddingRight="2" paddingTop="6" verticalAlign="inherit" whiteSpaceCollapse="preserve" xmlns="http://ns.adobe.com/textLayout/2008"><p><span>Word search</span></p></TextFlow>]]></p>
</div>
<div id="direction">
<p><![CDATA[<TextFlow columnCount="inherit" columnGap="inherit" columnWidth="inherit" fontFamily="Verdana" fontSize="9" lineBreak="inherit" paddingBottom="inherit" paddingLeft="2" paddingRight="2" paddingTop="6" verticalAlign="inherit" whiteSpaceCollapse="preserve" xmlns="http://ns.adobe.com/textLayout/2008"><p><span>Find the words in the grid</span></p></TextFlow>]]></p>
</div>
<div id="mask">
<p><![CDATA[Yes]]></p>
</div>
<div id="layout">
<p><![CDATA[13*13]]></p>
</div>
<div id="numOfGuesses">
<p><![CDATA[10]]></p>
</div>
<matchInteraction maxAssociations="2" responseIdentifier="RESPONSE" shuffle="true">
<simpleMatchSet>
<simpleAssociableChoice identifier="W_1" matchMax="1">
<p><![CDATA[harsha]]></p>
</simpleAssociableChoice>
<simpleAssociableChoice identifier="W_2" matchMax="1">
<p><![CDATA[dinakar]]></p>
</simpleAssociableChoice>
<simpleAssociableChoice identifier="W_3" matchMax="1">
<p><![CDATA[hurixsystems]]></p>
</simpleAssociableChoice>
<simpleAssociableChoice identifier="W_4" matchMax="1">
<p><![CDATA[aspire]]></p>
</simpleAssociableChoice>
<simpleAssociableChoice identifier="W_5" matchMax="1">
<p><![CDATA[india]]></p>
</simpleAssociableChoice>
<simpleAssociableChoice identifier="W_6" matchMax="1">
<p><![CDATA[kitab]]></p>
</simpleAssociableChoice>
<simpleAssociableChoice identifier="W_7" matchMax="1">
<p><![CDATA[google]]></p>
</simpleAssociableChoice>
<simpleAssociableChoice identifier="W_8" matchMax="1">
<p><![CDATA[australia]]></p>
</simpleAssociableChoice>
<simpleAssociableChoice identifier="W_9" matchMax="1">
<p><![CDATA[elephant]]></p>
</simpleAssociableChoice>
<simpleAssociableChoice identifier="W_10" matchMax="1">
<p><![CDATA[mumbai]]></p>
</simpleAssociableChoice>
<simpleAssociableChoice identifier="W_11" matchMax="1">
<p><![CDATA[hyderabad]]></p>
</simpleAssociableChoice>
<simpleAssociableChoice identifier="W_12" matchMax="1">
<p><![CDATA[chennai]]></p>
</simpleAssociableChoice>
<simpleAssociableChoice identifier="W_13" matchMax="1">
<p><![CDATA[dictera]]></p>
</simpleAssociableChoice>
</simpleMatchSet>
</matchInteraction>
//bla bla..
form the above xml i am trying to get array which contains "p-tag"values as a child of simpleMatchSet. my xpath query is like this
NSString *xmlFilePath=[[NSBundle mainBundle]pathForResource:@"wordsearchmain" ofType:@"xml"];
NSData *data=[[NSData alloc]initWithContentsOfFile:xmlFilePath];
NSString *xpathQuery = [[NSString alloc] initWithFormat:@"assessmentItem/itemBody/matchInteraction/simpleMatchSet/../simpleAssociableChoice/p/text()"];
NSDictionary *results = PerformXMLXPathQuery(data, xpathQuery);
[xpathQuery release];
i dont know where i did mistake to get data from the xml.can any one suggest me to correct my xpathQuery.Thanks all.All suggestions acceptable.
` tag. This could be one probable issue with this xpath