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>
|
2012-01-17 19:09-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||||
|
|
||||||
* Source/NSXMLNode.m: Add code to create nodes for comments,
|
* Source/NSXMLNode.m: Add code to create nodes for comments,
|
||||||
|
|
|
@ -69,9 +69,8 @@ GS_PRIVATE_INTERNAL(NSXMLDTDNode)
|
||||||
|
|
||||||
- (BOOL) isExternal
|
- (BOOL) isExternal
|
||||||
{
|
{
|
||||||
if (internal->systemID != nil)
|
if ([self systemID])
|
||||||
{
|
{
|
||||||
// FIXME ... libxml integration?
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -79,53 +78,37 @@ GS_PRIVATE_INTERNAL(NSXMLDTDNode)
|
||||||
|
|
||||||
- (NSString*) notationName
|
- (NSString*) notationName
|
||||||
{
|
{
|
||||||
if (internal->notationName == nil)
|
return StringFromXMLStringPtr(MY_DTD->name);
|
||||||
{
|
|
||||||
[self notImplemented: _cmd];
|
|
||||||
}
|
|
||||||
return internal->notationName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString*) publicID
|
- (NSString*) publicID
|
||||||
{
|
{
|
||||||
if (internal->publicID == nil)
|
return StringFromXMLStringPtr(MY_DTD->ExternalID);
|
||||||
{
|
|
||||||
[self notImplemented: _cmd];
|
|
||||||
}
|
|
||||||
return internal->publicID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setDTDKind: (NSXMLDTDNodeKind)kind
|
- (void) setDTDKind: (NSXMLDTDNodeKind)kind
|
||||||
{
|
{
|
||||||
internal->DTDKind = kind;
|
internal->DTDKind = kind;
|
||||||
// FIXME ... libxml integration?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setNotationName: (NSString*)notationName
|
- (void) setNotationName: (NSString*)notationName
|
||||||
{
|
{
|
||||||
ASSIGNCOPY(internal->notationName, notationName);
|
MY_DTD->name = XMLSTRING(notationName);
|
||||||
// FIXME ... libxml integration?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setPublicID: (NSString*)publicID
|
- (void) setPublicID: (NSString*)publicID
|
||||||
{
|
{
|
||||||
ASSIGNCOPY(internal->publicID, publicID);
|
MY_DTD->ExternalID = XMLSTRING(publicID);
|
||||||
// FIXME ... libxml integration?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setSystemID: (NSString*)systemID
|
- (void) setSystemID: (NSString*)systemID
|
||||||
{
|
{
|
||||||
ASSIGNCOPY(internal->systemID, systemID);
|
MY_DTD->ExternalID = XMLSTRING(systemID);
|
||||||
// FIXME ... libxml integration?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString*) systemID
|
- (NSString*) systemID
|
||||||
{
|
{
|
||||||
if (internal->systemID == nil)
|
return StringFromXMLStringPtr(MY_DTD->SystemID);
|
||||||
{
|
|
||||||
[self notImplemented: _cmd];
|
|
||||||
}
|
|
||||||
return internal->systemID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -629,6 +629,9 @@ NSArray *execute_xpath(NSXMLNode *node,
|
||||||
case NSXMLEntityDeclarationKind:
|
case NSXMLEntityDeclarationKind:
|
||||||
case NSXMLElementDeclarationKind:
|
case NSXMLElementDeclarationKind:
|
||||||
case NSXMLNotationDeclarationKind:
|
case NSXMLNotationDeclarationKind:
|
||||||
|
case NSXMLAttributeDeclarationKind:
|
||||||
|
node = xmlNewNode(NULL, (xmlChar *)"");
|
||||||
|
((xmlNodePtr)node)->type = XML_ATTRIBUTE_DECL;
|
||||||
theSubclass = [NSXMLDTDNode class];
|
theSubclass = [NSXMLDTDNode class];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -645,6 +648,14 @@ NSArray *execute_xpath(NSXMLNode *node,
|
||||||
node = xmlNewText((xmlChar *)"");
|
node = xmlNewText((xmlChar *)"");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case NSXMLNamespaceKind:
|
||||||
|
node = xmlNewNs(NULL,(xmlChar *)"",(xmlChar *)"");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSXMLAttributeKind:
|
||||||
|
node = xmlNewProp(NULL,(xmlChar *)"",(xmlChar *)"");
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,6 +84,7 @@ StringFromXMLString(const unsigned char *bytes, unsigned length)
|
||||||
#define MY_NODE ((xmlNode *)internal->node)
|
#define MY_NODE ((xmlNode *)internal->node)
|
||||||
#define MY_ATTR ((xmlAttr *)internal->node)
|
#define MY_ATTR ((xmlAttr *)internal->node)
|
||||||
#define MY_ELEM ((xmlElement *)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
|
/* Instance variables for NSXMLNode. This macro needs to be defined before
|
||||||
* the NSXMLNode.h header is imported and before GSInternal.h is imported.
|
* the NSXMLNode.h header is imported and before GSInternal.h is imported.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue