codebots-ltd / tbxml Goto Github PK
View Code? Open in Web Editor NEWSuper-fast, lightweight, easy to use XML parser for the Mac & iOS
Home Page: http://www.71squared.com
Super-fast, lightweight, easy to use XML parser for the Mac & iOS
Home Page: http://www.71squared.com
Would be awesome to see this in CocoaPods!
I am under the impression that the parser does not work properly since 7.1
All accented characters are replaced by other characters. For instance é is always replaced by √©
Anybody else having the same problem?
I'm trying to build you master branch on my build server. Build fails since "ARC_ENABLED" flag is not set by default.
Please fix default settings of your projects
Either set
CLANG_ENABLE_OBJC_ARC = NO
Or set
GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) ARC_ENABLED
/Users/darthvader/.jenkins/jobs/TBXML/workspace/TBXML-Code/TBXML+HTTP.m:21:13: error: 'autorelease' is unavailable: not available in automatic reference counting mode
return [request autorelease];
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:37:1: note: declaration has been explicitly marked unavailable here
Why can't I obtain the string "more text" with TextForElement() function?
<div>
<a href="/url/1">
<strong>value</strong>
</a>
more text
</div>
Title says it all. Strangely, when I access firstChild->text, I get correct result, but when I try to store firstChild into TBXMLElement, I get incorrect memory address.
In the definition of all the blocks used in TBXML, the parameter names are not specified so there is no way to know what each parameter represents without digging into the TBXML.m file.
Example:
typedef void (^TBXMLIterateAttributeBlock)(TBXMLAttribute *, NSString *, NSString *);
Should be:
typedef void (^TBXMLIterateAttributeBlock)(TBXMLAttribute *attribute, NSString *name, NSString *value);
Hello,
I just use the tbxml 1.4 for our iOS project, and thanks for your lib.
But always, I meet a memory leak issue point to the "textForElement" method.
But I'm not sure it's the issue of the code or just the issue of the sdk or profile tool.
Please reply me, if you have the time.
Thanks,
A iOS developer Chris
the most often error is
"Potential null dereference. According to coding standards in 'Creating and Returning NSError Objects' the parameter '' may be null"
Hi Tom,
sorry not native english speaker…
TBXML Podspec is not working anymore, you changed the files 5 days before.
should be like this i think:
"source_files": [
"TBXML-Code/.{h,m}",
"TBXML-Headers/.{h,m}"
but is now:
"source_files": "*.{h,m}“,
And currently the files are not found in Xcode Projects.
I hope this helps and you can fix the error soon.
Thank you and have a nice weekend.
Some news about that?
Any ideas on how to fix this error?
Project: Xcode 13 + Objective-C
thanks
In the method initWithXMLFile, in order to load the file the following code is used:
NSString * bundlePath = [[NSBundle bundleForClass:[self class]] pathForResource:aXMLFile ofType:aFileExtension];
I think this is not good. Because when aXMLFile is a file path with directory it won't load correctly. The best way to handle it is to use pathForResource in directory:
NSString *directory = [aXMLFile stringByDeletingLastPathComponent];
NSString *file = [aXMLFile lastPathComponent];
NSString * bundlePath = [[NSBundle bundleForClass:[self class]] pathForResource:file ofType:aFileExtension inDirectory:directory];
Hope you can fix it in the next version :)
Minor compared to, say, issue #23 (proper ARC detection) but it would be useful to have header files copied to a sensible location instead of the old "Public Headers Folder Path" default of /usr/local/include.
See knellr@c6d54f0 which uses the path "include/TBXML", allowing for TBXML to be included via #include <TBXML/TBXML.h>
Since there is no commit since one year and every issue is ignored - please move this project to some other people who cares about the issues.
I would like to report an error in the use of macros to support ARC.
file: TBXML+HTTP.m:
/****************************************************************/
return [request autorelease];
return request;
FIX:
return [request autorelease];
return request;
/****************************************************************/
[params release];
return [request autorelease];
return request;
FIX:
[params release];
return [request autorelease];
return request;
/****************************************************************/
file: TBXML.m:
/****************************************************************/
[super dealloc];
FIX:
[super dealloc];
/****************************************************************/
value = [NSString stringWithString:@""]; <<<<<<< fix warning
FIX:
value = @"";
/****************************************************************/
TBXML does NOT support 

for newline?
What should I do to add newline in my xml?
From what I can tell, this (very much improved in many ways) new version of TBXML assumes all XML files processed will be contained in the application bundle. That is absolutely a show-stopper for my requirements as I use XML files for all manner of communication between clients and server - most of which are never located "in the app bundle'.
I will implement my own work-around but it would be wonderful if this capability were incorporated into the official source code.
Thanks much!
Hi folks, I recently wondered why TBXML strips all whitespace inside XML text, as far as I understand the XML specification, this is not allowed. Shall we prepare a patch that allows/forbids this globally or just remove it?
example:
str =
@""
@""
@"<enclosure url='http://etch.s.dpool.sina.com.cn/nd/bbsdigi/myphoto_d/pic/2011/03/15/2023874167_733139c4cadbb9ffa223e80a02fa0127.jpg' type='image/jpeg' "
@"alt="" size='453*680'/>"
@"";
aData = [str dataUsingEncoding:NSUTF8StringEncoding];
// then parse nsdata aData, would got:
{
item = {
a = {
enclosure = {
alt = "453*680";
type = "image/jpeg";
url = "http://etch.s.dpool.sina.com.cn/nd/bbsdigi/myphoto_d/pic/2011/03/15/2023874167_733139c4cadbb9ffa223e80a02fa0127.jpg";
};
};
};
}
Reason:
text = 'test>>' contains >
Greetings!
I create this issue to make a question about your plugin.
We got an hybrid app and we decided to use a plugin called iRoot for avoiding rooted devices to run our app, this was a
requirement by Ethical hacking testers. The customer is pretty interested in checking all kinds of vulnerabilities in order to
be mitigated. This time a report was made about that plugin because it uses some functions which are considered dangerous; Those are memcpy and strlen, located in this file:
https://github.com/mapsplugin/cordova-plugin-googlemaps/blob/master/src/ios/GoogleMaps/TBXML.m
The mapsplugin team recently tell us that TBXML.m belongs to this library so we would like to know if you could help us with our question: ¿Do you have control on those functions usage (memcpy and strlen)? because we been told that they could produce memory overleaks
Thanks.
I favor using ARC in all of the apps I develop but I'm having a lot of trouble getting TBXML to function with ARC. Will there be a future release build that is compatible with ARC without having to modify any of the classes? Thanks in advance.
TBXML provides this method, which simply invokes another method with a nil
error pointer:
- (id)initWithXMLData:(NSData*)aData {
return [self initWithXMLData:aData error:nil];
}
There are other similar methods (-initWithXMLFile:
, -initWithXMLFile:fileExtension:
, etc.).
Unfortunately, if an error does occur, then the error handling code will try to dereference that nil pointer, and the app crashes. Some error-handling code does check for a null pointer before dereferencing it, but some does not.
Callers can work around this issue by calling the variant of the method that requires an error pointer. However, as-is these methods can easily lead to a crash, so I propose one of these actions be taken:
error
parameter. Require callers to pass an error parameter.error
variable.error
before trying to dereference it.On line 360 I get the following compiler warning regarding NSString:
TBXML.m:360:25: Using 'stringWithString:' with a literal is redundant
Could you please fix this line from
value = [NSString stringWithString:@""];
to
value = @"";
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.