Skip to content

Commit 44deb24

Browse files
author
Sebastian Majstorovic
committed
Fixed XML Parsing support for XPath-search.
1 parent 393c191 commit 44deb24

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

TFHpple.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ - (id) initWithHTMLData:(NSData *)theData
6464
// Returns all elements at xPath.
6565
- (NSArray *) search:(NSString *)xPathOrCSS
6666
{
67-
NSArray * detailNodes = PerformHTMLXPathQuery(data, xPathOrCSS);
67+
NSArray * detailNodes;
68+
if (isXML) {
69+
detailNodes = PerformXMLXPathQuery(data, xPathOrCSS);
70+
} else {
71+
detailNodes = PerformHTMLXPathQuery(data, xPathOrCSS);
72+
}
6873

6974
NSMutableArray * hppleElements = [NSMutableArray array];
7075
for (id node in detailNodes)

0 commit comments

Comments
 (0)