libxml2_uri.h File Reference

Typedef xmlURI

typedef struct _xmlURIxmlURI

xmlURI:

A parsed URI reference. This is a struct containing the various fields as described in RFC 2396 but separated for further processing.

Typedef xmlURIPtr

typedef xmlURI *xmlURIPtr

xmlCreateURI ( void )

XMLPUBFUN xmlURIPtr XMLCALLxmlCreateURI(void)

xmlCreateURI:

Simply creates an empty xmlURI

Returns the new structure or NULL in case of error

OOM: possible --> returns NULL , sets OOM flag

xmlBuildURI ( const xmlChar *, const xmlChar * )

XMLPUBFUN xmlChar *XMLCALLxmlBuildURI(const xmlChar *URI,
const xmlChar *base
)

xmlBuildURI: Computes he final URI of the reference done by checking that the given URI is valid, and building the final URI using the base URI. This is processed according to section 5.2 of the RFC 2396

5.2. Resolving Relative References to Absolute Form

Returns a new URI string (to be freed by the caller) or NULL in case of error.

OOM:

Parameters
URIthe URI instance found in the document
basethe base value

xmlParseURI ( const char * )

XMLPUBFUN xmlURIPtr XMLCALLxmlParseURI(const char *str)

xmlParseURI: Parse an URI

URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]

Returns a newly build xmlURIPtr or NULL in case of error

OOM: possible --> returns NULL for uri!=NULL

Parameters
strthe URI string to analyze

xmlParseURIReference ( xmlURIPtr, const char * )

XMLPUBFUN int XMLCALLxmlParseURIReference(xmlURIPtruri,
const char *str
)

xmlParseURIReference: Parse an URI reference string and fills in the appropriate fields of the uri structure

URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]

Returns 0 or the error code

OOM: possible --> sets OOM flag and returns XML_ERR_NO_MEMORY

Parameters
uripointer to an URI structure
strthe string to analyze

xmlSaveUri ( xmlURIPtr )

XMLPUBFUN xmlChar *XMLCALLxmlSaveUri(xmlURIPtruri)

xmlSaveUri: Save the URI as an escaped string

Returns a new string (to be deallocated by caller)

OOM:

Parameters
uripointer to an xmlURI

xmlPrintURI ( FILE *, xmlURIPtr )

XMLPUBFUN void XMLCALLxmlPrintURI(FILE *stream,
xmlURIPtruri
)

xmlPrintURI: Prints the URI in the stream stream.

Parameters
streama FILE* for the output
uripointer to an xmlURI

xmlURIEscapeStr ( const xmlChar *, const xmlChar * )

XMLPUBFUN xmlChar *XMLCALLxmlURIEscapeStr(const xmlChar *str,
const xmlChar *list
)

xmlURIEscapeStr: This routine escapes a string to hex, ignoring reserved characters (a-z) and the characters in the exception list.

Returns a new escaped string or NULL in case of error.

Parameters
strstring to escape
listexception list string of chars not to escape

xmlURIUnescapeString ( const char *, int, char * )

XMLPUBFUN char *XMLCALLxmlURIUnescapeString(const char *str,
intlen,
char *target
)

xmlURIUnescapeString: Unescaping routine, does not do validity checks ! Output is direct unsigned char translation of XX values (no encoding)

Returns an copy of the string, but unescaped

OOM: possible --> sets OOM when returns NULL for target==NULL

Parameters
strthe string to unescape
lenthe length in bytes to unescape (or <= 0 to indicate full string)
targetoptional destination buffer

xmlNormalizeURIPath ( char * )

XMLPUBFUN int XMLCALLxmlNormalizeURIPath(char *path)

xmlNormalizeURIPath: Applies the 5 normalization steps to a path string--that is, RFC 2396 Section 5.2, steps 6.c through 6.g.

Normalization occurs directly on the string, no new allocation is done

Returns 0 or an error code

Parameters
pathpointer to the path string

xmlURIEscape ( const xmlChar * )

XMLPUBFUN xmlChar *XMLCALLxmlURIEscape(const xmlChar *str)

xmlURIEscape: Escaping routine, does not do validity checks ! It will try to escape the chars needing this, but this is heuristic based it's impossible to be sure.

Returns an copy of the string, but escaped

25 May 2001 Uses xmlParseURI and xmlURIEscapeStr to try to escape correctly according to RFC2396.
  • Carl Douglas

Parameters
strthe string of the URI to escape

xmlFreeURI ( xmlURIPtr )

XMLPUBFUN void XMLCALLxmlFreeURI(xmlURIPtruri)

xmlFreeURI: Free up the xmlURI struct

Parameters
uripointer to an xmlURI

xmlCanonicPath ( const xmlChar * )

XMLPUBFUN xmlChar *XMLCALLxmlCanonicPath(const xmlChar *path)