uri

Name

uri -- 

Synopsis



struct      xmlURI;
typedef     xmlURIPtr;
xmlURIPtr   xmlCreateURI                    (void);
xmlChar*    xmlBuildURI                     (const xmlChar *URI,
                                             const xmlChar *base);
xmlURIPtr   xmlParseURI                     (const char *URI);
int         xmlParseURIReference            (xmlURIPtr uri,
                                             const char *str);
xmlChar*    xmlSaveUri                      (xmlURIPtr uri);
void        xmlPrintURI                     (FILE *stream,
                                             xmlURIPtr uri);
char*       xmlURIUnescapeString            (const char *str,
                                             int len,
                                             char *target);
int         xmlNormalizeURIPath             (char *path);
xmlChar*    xmlURIEscape                    (const xmlChar *str);
void        xmlFreeURI                      (xmlURIPtr uri);

Description

Details

struct xmlURI

struct xmlURI {
    char *scheme;
    char *opaque;
    char *authority;
    char *server;
    char *user;
    int port;
    char *path;
    char *query;
    char *fragment;
};


xmlURIPtr

typedef xmlURI *xmlURIPtr;


xmlCreateURI ()

xmlURIPtr   xmlCreateURI                    (void);

Simply creates an empty xmlURI

Returns :the new structure or NULL in case of error


xmlBuildURI ()

xmlChar*    xmlBuildURI                     (const xmlChar *URI,
                                             const xmlChar *base);

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

URI : the URI instance found in the document
base : the base value
Returns :a new URI string (to be freed by the caller) or NULL in case of error.


xmlParseURI ()

xmlURIPtr   xmlParseURI                     (const char *URI);

Parse an URI

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

URI : 
Returns :a newly build xmlURIPtr or NULL in case of error


xmlParseURIReference ()

int         xmlParseURIReference            (xmlURIPtr uri,
                                             const char *str);

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

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

uri : pointer to an URI structure
str : the string to analyze
Returns :0 or the error code


xmlSaveUri ()

xmlChar*    xmlSaveUri                      (xmlURIPtr uri);

Save the URI as an escaped string

uri : pointer to an xmlURI
Returns :a new string (to be deallocated by caller)


xmlPrintURI ()

void        xmlPrintURI                     (FILE *stream,
                                             xmlURIPtr uri);

Prints the URI in the stream steam.

stream : a FILE* for the output
uri : pointer to an xmlURI


xmlURIUnescapeString ()

char*       xmlURIUnescapeString            (const char *str,
                                             int len,
                                             char *target);

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

str : the string to unescape
len : the lenght in bytes to unescape (or <= 0 to indicate full string)
target : optionnal destination buffer
Returns :an copy of the string, but unescaped


xmlNormalizeURIPath ()

int         xmlNormalizeURIPath             (char *path);

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

path : pointer to the path string
Returns :0 or an error code


xmlURIEscape ()

xmlChar*    xmlURIEscape                    (const xmlChar *str);

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.

str : the string of the URI to escape
Returns :an copy of the string, but escaped


xmlFreeURI ()

void        xmlFreeURI                      (xmlURIPtr uri);

Free up the xmlURI struct

uri : pointer to an xmlURI