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)
- Youtube upload file failed with error 500 (internal erro) HOT 1
- Crash in the GDataXMLNode class
- Code can not be build after adding GDataXMLNode.o HOT 1
- Picasa user album list query only returns partial result HOT 2
- Photo Entry returned without thumbnail HOT 1
- OAuth 2 Login screen unusable when viewed in Arabic HOT 4
- can't connect to my account programmatically using GDataServiceGoogleAnalytics service HOT 1
- user tags fetch returns tags no longer in use HOT 1
- Errors when using non UTF-8 characters HOT 1
- GData svn checkout HOT 1
- token nil with youtube api v3 on ios HOT 1
- Building the framework in Xcode 5.1 causes an unused variable 'kTitleAttr' error HOT 3
- Failure callback not working in iOS
- Duplicate Symbol
- sign in within the app | removing the safari redirection
- Linker errors when using google-objectivec-client and google-plus-ios-sdk HOT 2
- GDataXMLNode.m repeat in compile sources HOT 1
- Memory Uses Keep Increasing
- GData does not validate server certificate HOT 1
- ContactsSample simplecode cannot log on to google. HOT 1
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.