Comments (3)
Original comment by gregrobbins
on 30 Jun 2009 at 1:35
- Changed state: Accepted
from gdata-objectivec-client.
Thanks for pointing out the issue and providing an alternative. You're right
that the
library is in error in registering the empty-string prefix.
This led to some interesting discussion here about safe XPath expressions.
While NSXML's XPath does implicitly prefix expression elements with the node's
default namespace, that is not really safe. There is no guarantee that future
XML
will have the same default namespace, or that prefix-URI mappings will remain
the
same. If either of those changes, the XPath expression will give unexpected
results.
Trying to alter the user's XPath expression is difficult to do correctly.
Issues
like whitespace, OR operators (|'s), and other compound expressions make trying
to
insert a prefix automatically in a reliable way quite a difficult task.
I will add to the library an XPath call which takes a dictionary explicitly
mapping
prefixes (keys) to URIs (values), allowing for reliable XPath expressions that
can
access nodes on the default namespace. Using that will look like:
path = @"atom:entry/atom:link"; // four entry link nodes
dict = [NSDictionary dictionaryWithObject:kGDataNamespaceAtom
forKey:kGDataNamespaceAtomPrefix];
nodes = [root nodesForXPath:path
namespaces:dict
error:&error];
Additionally, the plain nodesForXPath:error: method will allow _def_ns as a
prefix
referring to the default namespace. However, it will safer to use the XPath
method
which takes the explicit namespace dictionary.
Original comment by gregrobbins
on 2 Jul 2009 at 12:41
from gdata-objectivec-client.
Better namespace support is now in top-of-trunk GDataXMLNode.
http://code.google.com/p/gdata-objectivec-client/source/detail?r=288
Original comment by gregrobbins
on 3 Jul 2009 at 1:16
- Changed state: Fixed
from gdata-objectivec-client.
Related Issues (20)
- GDataXMLNode.m repeat in compile sources HOT 1
- Memory Uses Keep Increasing
- GData does not validate server certificate HOT 1
- Question about which Google API to use
- Lib & samples not compile since last cleanup
- Compatibility with iOS9 HOT 10
- Is this api deprecated for spreadsheet service ? HOT 5
- Gdata and GTLDrive API's don't work well together in IOS HOT 3
- PBXCp Errors -- GTMHTTP files are missing
- PBXcp Error
- ไปป์ วัดสิงห์ HOT 1
- Xcode 7.3b4, non-arc, cannot create __weak reference HOT 8
- Using GData with GTMSessionFetcher failed HOT 1
- Photos upload does not work anymore HOT 4
- Getting No response from server 404 HOT 8
- How could i integrate GTMAppAuth into SDK? HOT 2
- GDataEntryContact returned without birthday
- Photos can't create album HOT 1
- GTMGatherInputStream.h: No such file or directory HOT 2
- [!] Error installing GData Cocoapods HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gdata-objectivec-client.