Handle result of parse method

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22835 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2006-04-28 10:57:47 +00:00
parent 576fbc945e
commit c16a063c31
2 changed files with 25 additions and 13 deletions

View file

@ -1,6 +1,8 @@
2006-04-28 Richard Frith-Macdonald <rfm@gnu.org> 2006-04-28 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSKeyedUnarchiver.m: Fix decoding of NSNull objects. * Source/NSKeyedUnarchiver.m: Fix decoding of NSNull objects.
* Source/Additions/GSXML.m: Ensure that calls to parse documents
handle the success/failure value returned.
2006-04-27 Richard Frith-Macdonald <rfm@gnu.org> 2006-04-27 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -23,7 +23,8 @@
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
<title>The XML and HTML parsing system</title> <title>The XML and HTML parsing system</title>
<chapter> <chapter>
@ -3861,13 +3862,18 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
GSXMLParser *ssParser; GSXMLParser *ssParser;
GSXMLDocument *ss; GSXMLDocument *ss;
newdoc = nil;
xmlParser = [GSXMLParser parserWithData: xmlData]; xmlParser = [GSXMLParser parserWithData: xmlData];
[xmlParser parse]; if ([xmlParser parse] == YES)
xml = [xmlParser document]; {
ssParser = [GSXMLParser parserWithData: xsltStylesheet]; xml = [xmlParser document];
[ssParser parse]; ssParser = [GSXMLParser parserWithData: xsltStylesheet];
ss = [ssParser document]; if ([ssParser parse] == YES)
newdoc = [xml xsltTransform: ss params: params]; {
ss = [ssParser document];
newdoc = [xml xsltTransform: ss params: params];
}
}
} }
NS_HANDLER NS_HANDLER
{ {
@ -4961,9 +4967,11 @@ static void indentation(unsigned level, NSMutableString *str)
GSXMLDocument *doc = nil; GSXMLDocument *doc = nil;
[parser substituteEntities: YES]; [parser substituteEntities: YES];
[parser parse]; if ([parser parse] == YES)
doc = [parser document]; {
ctx = AUTORELEASE([[GSXPathContext alloc] initWithDocument: doc]); doc = [parser document];
ctx = AUTORELEASE([[GSXPathContext alloc] initWithDocument: doc]);
}
} }
NS_HANDLER NS_HANDLER
{ {
@ -5032,9 +5040,11 @@ static void indentation(unsigned level, NSMutableString *str)
GSXMLDocument *doc = nil; GSXMLDocument *doc = nil;
[parser substituteEntities: YES]; [parser substituteEntities: YES];
[parser parse]; if ([parser parse] == YES)
doc = [parser document]; {
ctx = AUTORELEASE([[GSXPathContext alloc] initWithDocument: doc]); doc = [parser document];
ctx = AUTORELEASE([[GSXPathContext alloc] initWithDocument: doc]);
}
} }
NS_HANDLER NS_HANDLER
{ {