mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
* Source/NSXMLNode.m: Add code in initWithKind
* Source/NSXMLDTDNode.m: Remove attributes, use libxml2 structures instead. * Source/NSXMLPrivate.h: Add define for MY_DTD. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/nsxml_using_libxml2@34577 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ea4ea8e081
commit
f3a158c77f
4 changed files with 26 additions and 24 deletions
|
@ -1,3 +1,10 @@
|
|||
2012-01-18 12:22-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/NSXMLNode.m: Add code in initWithKind
|
||||
* Source/NSXMLDTDNode.m: Remove attributes, use libxml2 structures
|
||||
instead.
|
||||
* Source/NSXMLPrivate.h: Add define for MY_DTD.
|
||||
|
||||
2012-01-17 19:09-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/NSXMLNode.m: Add code to create nodes for comments,
|
||||
|
|
|
@ -69,9 +69,8 @@ GS_PRIVATE_INTERNAL(NSXMLDTDNode)
|
|||
|
||||
- (BOOL) isExternal
|
||||
{
|
||||
if (internal->systemID != nil)
|
||||
if ([self systemID])
|
||||
{
|
||||
// FIXME ... libxml integration?
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
|
@ -79,53 +78,37 @@ GS_PRIVATE_INTERNAL(NSXMLDTDNode)
|
|||
|
||||
- (NSString*) notationName
|
||||
{
|
||||
if (internal->notationName == nil)
|
||||
{
|
||||
[self notImplemented: _cmd];
|
||||
}
|
||||
return internal->notationName;
|
||||
return StringFromXMLStringPtr(MY_DTD->name);
|
||||
}
|
||||
|
||||
- (NSString*) publicID
|
||||
{
|
||||
if (internal->publicID == nil)
|
||||
{
|
||||
[self notImplemented: _cmd];
|
||||
}
|
||||
return internal->publicID;
|
||||
return StringFromXMLStringPtr(MY_DTD->ExternalID);
|
||||
}
|
||||
|
||||
- (void) setDTDKind: (NSXMLDTDNodeKind)kind
|
||||
{
|
||||
internal->DTDKind = kind;
|
||||
// FIXME ... libxml integration?
|
||||
}
|
||||
|
||||
- (void) setNotationName: (NSString*)notationName
|
||||
{
|
||||
ASSIGNCOPY(internal->notationName, notationName);
|
||||
// FIXME ... libxml integration?
|
||||
MY_DTD->name = XMLSTRING(notationName);
|
||||
}
|
||||
|
||||
- (void) setPublicID: (NSString*)publicID
|
||||
{
|
||||
ASSIGNCOPY(internal->publicID, publicID);
|
||||
// FIXME ... libxml integration?
|
||||
MY_DTD->ExternalID = XMLSTRING(publicID);
|
||||
}
|
||||
|
||||
- (void) setSystemID: (NSString*)systemID
|
||||
{
|
||||
ASSIGNCOPY(internal->systemID, systemID);
|
||||
// FIXME ... libxml integration?
|
||||
MY_DTD->ExternalID = XMLSTRING(systemID);
|
||||
}
|
||||
|
||||
- (NSString*) systemID
|
||||
{
|
||||
if (internal->systemID == nil)
|
||||
{
|
||||
[self notImplemented: _cmd];
|
||||
}
|
||||
return internal->systemID;
|
||||
return StringFromXMLStringPtr(MY_DTD->SystemID);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -629,6 +629,9 @@ NSArray *execute_xpath(NSXMLNode *node,
|
|||
case NSXMLEntityDeclarationKind:
|
||||
case NSXMLElementDeclarationKind:
|
||||
case NSXMLNotationDeclarationKind:
|
||||
case NSXMLAttributeDeclarationKind:
|
||||
node = xmlNewNode(NULL, (xmlChar *)"");
|
||||
((xmlNodePtr)node)->type = XML_ATTRIBUTE_DECL;
|
||||
theSubclass = [NSXMLDTDNode class];
|
||||
break;
|
||||
|
||||
|
@ -645,6 +648,14 @@ NSArray *execute_xpath(NSXMLNode *node,
|
|||
node = xmlNewText((xmlChar *)"");
|
||||
break;
|
||||
|
||||
case NSXMLNamespaceKind:
|
||||
node = xmlNewNs(NULL,(xmlChar *)"",(xmlChar *)"");
|
||||
break;
|
||||
|
||||
case NSXMLAttributeKind:
|
||||
node = xmlNewProp(NULL,(xmlChar *)"",(xmlChar *)"");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ StringFromXMLString(const unsigned char *bytes, unsigned length)
|
|||
#define MY_NODE ((xmlNode *)internal->node)
|
||||
#define MY_ATTR ((xmlAttr *)internal->node)
|
||||
#define MY_ELEM ((xmlElement *)internal->node)
|
||||
#define MY_DTD ((xmlDtd *)internal->node)
|
||||
|
||||
/* Instance variables for NSXMLNode. This macro needs to be defined before
|
||||
* the NSXMLNode.h header is imported and before GSInternal.h is imported.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue