CFXMLNode_HD.h



Functions

CFXMLNodeCreate

Abstract: Creates a new CFXMLNode.
CFXMLNodeRef CFXMLNodeCreate(CFAllocatorRef alloc, CFXMLNodeTypeCode xmlType, CFStringRef dataString, const void *additionalInfoPtr, CFIndex version);

Parameters

NameDescription
allocThe memory allocator to use. Pass NULL or kCFAllocatorDefault to use the system allocator.
xmlTypeType identifier code for the XML structure you want this node to describe.
dataStringThe XML data.
additionalInfoPtrA pointer to a structure containing additional information about the XML data.
versionThe version number of the CFXMLNode you want to create. Pass one of the pre-defined constants, typically kCFXMLNodeCurrentVersion.
Result: The newly created CFXMLNode.

CFXMLNodeCreateCopy

Abstract: Creates a copy of a CFXMLNode.
CFXMLNodeRef CFXMLNodeCreateCopy(CFAllocatorRef alloc, CFXMLNodeRef origNode);

Parameters

NameDescription
allocThe memory allocator to use. Pass NULL or kCFAllocatorDefault to use the system allocator.
origNodeThe node to copy. Do not pass NULL.
Result: The newly created CFXMLNode.

CFXMLNodeGetInfoPtr

Abstract: Obtains the additional info pointer from the CFXMLNode.
const void *CFXMLNodeGetInfoPtr(CFXMLNodeRef node);

Parameters

NameDescription
nodeThe CFXMLNode whose additional info pointer you wish to obtain.
Result: The additional info pointer from the CFXMLNode. See CFXMLNodeTypeCode for information about the the various structures that are returned in the additional info pointer.

CFXMLNodeGetString

Abstract: Obtains the data string from the CFXMLNode.
CFStringRef CFXMLNodeGetString(CFXMLNodeRef node);

Parameters

NameDescription
nodeThe CFXMLNode whose data string you wish to obtain.
Result: The data string from the CFXMLNode.

CFXMLNodeGetTypeCode

Abstract: Obtains the XML structure type code for the CFXMLNode.
CFXMLNodeTypeCode CFXMLNodeGetTypeCode(CFXMLNodeRef node);

Parameters

NameDescription
nodeThe CFXMLNode whose type code you wish to obtain.
Result: The type code for the CFXMLNode.

CFXMLNodeGetTypeID

Abstract: Obtains the Core Foundation type identifier code for a CFXMLNode.
CFTypeID CFXMLNodeGetTypeID(void);

Result: The type identifier.

CFXMLNodeGetVersion

Abstract: Obtains the version number for the CFXMLNode.
CFIndex CFXMLNodeGetVersion(CFXMLNodeRef node);

Parameters

NameDescription
nodeThe CFXMLNode whose version number you wish to obtain.
Result: The version number for the CFXMLNode.

CFXMLTreeCreateWithNode

Abstract: Creates a childless, parentless CFXMLTree node using a CFXMLNode.
CFXMLTreeRef CFXMLTreeCreateWithNode(CFAllocatorRef allocator, CFXMLNodeRef node);

A CFXMLTree is simply a type of CFTree that has only CFXMLNodes along with known contexts and callbacks.

Parameters

NameDescription
allocatorThe memory allocator to use. Pass NULL or kCFAllocatorDefault to use the system allocator.
nodeThe CFXMLNode to use when creating the new CFXMLTree node.
Result: The CFXMLTree node.

CFXMLTreeGetNode

Abstract: Obtains a CFXMLNode from a CFXMLTree.
CFXMLNodeRef CFXMLTreeGetNode(CFXMLTreeRef xmlTree);

A CFXMLTree is simply a type of CFTree that has only CFXMLNodes along with known contexts and callbacks.

Parameters

NameDescription
CFXMLTreeThe CFXMLTree node from which the CFXMLNode will be extracted.
Result: The CFXMLNode.

Typedefs

CFXMLAttributeDeclarationInfo

typedef  struct  {
  /*  This  is  expected  to  change  in  future  versions  */
  CFStringRef  attributeName;
  CFStringRef  typeString;
  CFStringRef  defaultString;
}  CFXMLAttributeDeclarationInfo;

This structure is part of the definition of the CFXMLAttributeListDeclarationInfo structure.

Fields

NameDescription
attributeNameThe name of the attribute.
typeStringDescribes the declaration of a single attribute.
defaultStringThe attribute's default value.

CFXMLAttributeListDeclarationInfo

typedef  struct  {
  CFIndex  numberOfAttributes;
  CFXMLAttributeDeclarationInfo  *attributes;
}  CFXMLAttributeListDeclarationInfo;

A pointer to this structure is included in the CFXMLNode passed to your application when the parser encounters an attribute declaration in the DTD. Use the function CFXMLNodeGetInfoPtr to obtain the pointer to this structure.

Fields

NameDescription
numberOfAttributesThe number of attributes in the array.
attributesAn array of attributes.

CFXMLDocumentInfo

typedef  struct  {
  CFURLRef  sourceURL;
  CFStringEncoding  encoding;
}  CFXMLDocumentInfo;

A pointer to this structure is included in the CFXMLNode passed to your application when the parser encounters the XML declaration. Use the function CFXMLNodeGetInfoPtr to obtain the pointer.

Fields

NameDescription
sourceURLThe source URL of the XML document.
encodingThe text encoding of the XML document.

CFXMLDocumentTypeInfo

typedef  struct  {
  CFXMLExternalID  externalID;
}  CFXMLDocumentTypeInfo;

A pointer to this structure is included in the CFXMLNode passed to your application when the parser encounters the the beginning of the DTD. Use the function CFXMLNodeGetInfoPtr to obtain a pointer to this structure.

Fields

NameDescription
externalIDThe external ID of the DTD.

CFXMLElementInfo

typedef  struct  {
  CFDictionaryRef  attributes;
  CFArrayRef  attributeOrder;
  Boolean  isEmpty;
}  CFXMLElementInfo;

A pointer to this structure is included in the CFXMLNode passed to your application when the parser encounters an element containing attributes. Use the function CFXMLNodeGetInfoPtr to obtain the pointer.

Fields

NameDescription
attributesThe dictionary of attribute values.
attributeOrderAn array specifying the order in which the attributes appeared in the XML document.
isEmptyA flag indicating whether the element was expressed in closed form.

CFXMLElementTypeDeclarationInfo

typedef  struct  {
  /*  This  is  expected  to  change  in  future  versions  */
  CFStringRef  contentDescription;
}  CFXMLElementTypeDeclarationInfo;

A pointer to this structure is included in the CFXMLNode passed to your application when the parser encounters and element type declaration. Use the function CFXMLNodeGetInfoPtr to obtain a pointer to this structure.

Fields

NameDescription
contentDescriptionA textual description of the element type.

CFXMLEntityInfo

typedef  struct  {
  CFXMLEntityTypeCode  entityType;
  CFStringRef  replacementText;  
  CFXMLExternalID  entityID;
  CFStringRef  notationName;
}  CFXMLEntityInfo;

A pointer to this structure is included in the CFXMLNode passed to your application when the parser encounters an entity declaration. Use the function CFXMLNodeGetInfoPtr to obtain a pointer to this structure.

Fields

NameDescription
entityTypeThe entity type code.
replacementTextNULL if entityType is external or unparsed, otherwise the text that the entity should be replaced with.
entityIDentityID.systemID will be NULL if entityType is internal.
notationNameNULL if entityType is parsed.

CFXMLEntityReferenceInfo

typedef  struct  {
  CFXMLEntityTypeCode  entityType;
}  CFXMLEntityReferenceInfo;

A pointer to this structure is included in the CFXMLNode passed to your application when the parser encounters an entity reference. Use the function CFXMLNodeGetInfoPtr to obtain the pointer.

Fields

NameDescription
entityTypeThe entity type code.

CFXMLExternalID

typedef  struct  {
  CFURLRef  systemID;
  CFStringRef  publicID;
}  CFXMLExternalID;

This structure is part of the definition of the CFXMLDocumentTypeInfo, CFXMLNotationInfo, and CFXMLEntityInfo structures.

Fields

NameDescription
systemIDThe systemID URL.
publicIDThe publicID string.

CFXMLNodeRef

typedef  const  struct  __CFXMLNode  *  CFXMLNodeRef;


CFXMLNotationInfo

typedef  struct  {
  CFXMLExternalID  externalID;
}  CFXMLNotationInfo;

A pointer to this structure is included in the CFXMLNode passed to your application when the parser encounters . Use the function CFXMLNodeGetInfoPtr to obtain a pointer to this structure.

Fields

NameDescription
externalIDThe external ID of the notation.

CFXMLProcessingInstructionInfo

typedef  struct  {
  CFStringRef  dataString;
}  CFXMLProcessingInstructionInfo;

A pointer to this structure is included in the CFXMLNode passed to your application when the parser encounters a processing instruction. Use the function CFXMLNodeGetInfoPtr to obtain the pointer.

Fields

NameDescription
dataStringThe text of the processing instruction.

CFXMLTreeRef

typedef  CFTreeRef  CFXMLTreeRef;

When using the high-level parser API, XML data is parsed to a special CFTree which is simply a CFXMLTree with known contexts and callbacks. The nodes of a CFXMLTree may be queried using the basic CFTree interface (to report on the structure of the tree itself), or via the functions here (to report on the XML contents of the nodes).


© 2000 Apple Computer, Inc. — (Last Updated 7/20/2000)