http://swpat.ffii.org/
Action against software patents
http://www.gnome.org/
Gnome2 Logo
http://www.w3.org/Status
W3C Logo
http://www.redhat.com/
Red Hat Logo
http://xmlsoft.org/
Made with Libxml2 Logo
Module uri from libxml2
API Menu
../index.html
Main Menu
../docs.html
Developer Menu
../examples/index.html
Code Examples
index.html
API Menu
libxml-parser.html
Parser API
libxml-tree.html
Tree API
libxml-xmlreader.html
Reader API
../guidelines.html
XML Guidelines
../ChangeLog.html
ChangeLog
API Indexes
../APIchunk0.html
Alphabetic
../APIconstructors.html
Constructors
../APIfunctions.html
Functions/Types
../APIfiles.html
Modules
../APIsymbols.html
Symbols
Related links
http://mail.gnome.org/archives/xml/
Mail archive
http://xmlsoft.org/XSLT/
XSLT libxslt
http://phd.cs.unibo.it/gdome2/
DOM gdome2
http://www.aleksey.com/xmlsec/
XML-DSig xmlsec
ftp://xmlsoft.org/
FTP
http://www.zlatkovic.com/projects/libxml/
Windows binaries
http://www.blastwave.org/packages.php/libxml2
Solaris binaries
http://www.explain.com.au/oss/libxml2xslt.html
MacOsX binaries
http://libxmlplusplus.sourceforge.net/
C++ bindings
http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4
PHP bindings
http://sourceforge.net/projects/libxml2-pas/
Pascal bindings
http://rubyforge.org/projects/xml-tools/
Ruby bindings
http://tclxml.sourceforge.net/
Tcl bindings
http://bugzilla.gnome.org/buglist.cgi?product=libxml2
Bug Tracker
libxml-tree.html
Prev
libxml-tree.html
tree
index.html
Up
index.html
API documentation
../index.html
Home
../index.html
The XML C parser and toolkit of Gnome
libxml-valid.html
valid
libxml-valid.html
Next
library of generic URI related routines Implements RFC 2396
Table of Contents
Structure
#xmlURI
xmlURI
struct _xmlURI
Typedef
libxml-uri.html#xmlURI
xmlURI
*
xmlURIPtr
libxml-xmlstring.html#xmlChar
xmlChar
*
#xmlBuildRelativeURI
xmlBuildRelativeURI
(const
libxml-xmlstring.html#xmlChar
xmlChar
* URI,
const
libxml-xmlstring.html#xmlChar
xmlChar
* base)
libxml-xmlstring.html#xmlChar
xmlChar
*
#xmlBuildURI
xmlBuildURI
(const
libxml-xmlstring.html#xmlChar
xmlChar
* URI,
const
libxml-xmlstring.html#xmlChar
xmlChar
* base)
libxml-xmlstring.html#xmlChar
xmlChar
*
#xmlCanonicPath
xmlCanonicPath
(const
libxml-xmlstring.html#xmlChar
xmlChar
* path)
libxml-uri.html#xmlURIPtr
xmlURIPtr
#xmlCreateURI
xmlCreateURI
(void)
void
#xmlFreeURI
xmlFreeURI
(
libxml-uri.html#xmlURIPtr
xmlURIPtr
uri)
int
#xmlNormalizeURIPath
xmlNormalizeURIPath
(char * path)
libxml-uri.html#xmlURIPtr
xmlURIPtr
#xmlParseURI
xmlParseURI
(const char * str)
int
#xmlParseURIReference
xmlParseURIReference
(
libxml-uri.html#xmlURIPtr
xmlURIPtr
uri,
const char * str)
void
#xmlPrintURI
xmlPrintURI
(FILE * stream,
libxml-uri.html#xmlURIPtr
xmlURIPtr
uri)
libxml-xmlstring.html#xmlChar
xmlChar
*
#xmlSaveUri
xmlSaveUri
(
libxml-uri.html#xmlURIPtr
xmlURIPtr
uri)
libxml-xmlstring.html#xmlChar
xmlChar
*
#xmlURIEscape
xmlURIEscape
(const
libxml-xmlstring.html#xmlChar
xmlChar
* str)
libxml-xmlstring.html#xmlChar
xmlChar
*
#xmlURIEscapeStr
xmlURIEscapeStr
(const
libxml-xmlstring.html#xmlChar
xmlChar
* str,
const
libxml-xmlstring.html#xmlChar
xmlChar
* list)
char *
#xmlURIUnescapeString
xmlURIUnescapeString
(const char * str,
int len,
char * target)
Description
Structure xmlURI
Structure xmlURI
struct _xmlURI {
char *	scheme	: the URI scheme
char *	opaque	: opaque part
char *	authority	: the authority part
char *	server	: the server part
char *	user	: the user part
int	port	: the port number
char *	path	: the path string
char *	query	: the query string
char *	fragment	: the fragment identifier
int	cleanup	: parsing potentially unclean URI
}
Function: xmlBuildRelativeURI
libxml-xmlstring.html#xmlChar
xmlChar
*	xmlBuildRelativeURI	(const
libxml-xmlstring.html#xmlChar
xmlChar
* URI,
const
libxml-xmlstring.html#xmlChar
xmlChar
* base)
Expresses the URI of the
libxml-SAX.html#reference
reference
in terms relative to the base. Some examples of this operation include: base = "http://site1.com/docs/book1.html" URI input URI returned docs/pic1.gif pic1.gif docs/img/pic1.gif img/pic1.gif img/pic1.gif ../img/pic1.gif http://site1.com/docs/pic1.gif pic1.gif http://site2.com/docs/pic1.gif http://site2.com/docs/pic1.gif base = "docs/book1.html" URI input URI returned docs/pic1.gif pic1.gif docs/img/pic1.gif img/pic1.gif img/pic1.gif ../img/pic1.gif http://site1.com/docs/pic1.gif http://site1.com/docs/pic1.gif Note: if the URI
libxml-SAX.html#reference
reference
is really wierd or complicated, it may be worthwhile to first convert it into a "nice" one by calling
libxml-uri.html#xmlBuildURI
xmlBuildURI
(using 'base') before calling this routine, since this routine (for reasonable efficiency) assumes URI has already been through some validation.
URI
:
the URI
libxml-SAX.html#reference
reference
under consideration
base
:
the base value
Returns
:
a new URI string (to be freed by the caller) or NULL in case error.
Function: xmlBuildURI
libxml-xmlstring.html#xmlChar
xmlChar
*	xmlBuildURI		(const
libxml-xmlstring.html#xmlChar
xmlChar
* URI,
const
libxml-xmlstring.html#xmlChar
xmlChar
* base)
Computes he final URI of the
libxml-SAX.html#reference
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.
Function: xmlCanonicPath
libxml-xmlstring.html#xmlChar
xmlChar
*	xmlCanonicPath		(const
libxml-xmlstring.html#xmlChar
xmlChar
* path)
Constructs a canonic path from the specified path.
path
:
the resource locator in a filesystem notation
Returns
:
a new canonic path, or a duplicate of the path parameter if the construction fails. The caller is responsible for freeing the memory occupied by the returned string. If there is insufficient memory available, or the argument is NULL, the function returns NULL.
Function: xmlCreateURI
libxml-uri.html#xmlURIPtr
xmlURIPtr
xmlCreateURI		(void)
Simply creates an empty
libxml-uri.html#xmlURI
xmlURI
Returns
:
the new structure or NULL in case of error
Function: xmlFreeURI
void	xmlFreeURI			(
libxml-uri.html#xmlURIPtr
xmlURIPtr
uri)
Free up the
libxml-uri.html#xmlURI
xmlURI
struct
uri
:
pointer to an
libxml-uri.html#xmlURI
xmlURI
Function: 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
Function: xmlParseURI
libxml-uri.html#xmlURIPtr
xmlURIPtr
xmlParseURI		(const char * str)
Parse an URI URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
str
:
the URI string to analyze
Returns
:
a newly built
libxml-uri.html#xmlURIPtr
xmlURIPtr
or NULL in case of error
Function: xmlParseURIReference
int	xmlParseURIReference		(
libxml-uri.html#xmlURIPtr
xmlURIPtr
uri,
const char * str)
Parse an URI
libxml-SAX.html#reference
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
Function: xmlPrintURI
void	xmlPrintURI			(FILE * stream,
libxml-uri.html#xmlURIPtr
xmlURIPtr
uri)
Prints the URI in the stream @stream.
stream
:
a FILE* for the output
uri
:
pointer to an
libxml-uri.html#xmlURI
xmlURI
Function: xmlSaveUri
libxml-xmlstring.html#xmlChar
xmlChar
*	xmlSaveUri		(
libxml-uri.html#xmlURIPtr
xmlURIPtr
uri)
Save the URI as an escaped string
uri
:
pointer to an
libxml-uri.html#xmlURI
xmlURI
Returns
:
a new string (to be deallocated by caller)
Function: xmlURIEscape
libxml-xmlstring.html#xmlChar
xmlChar
*	xmlURIEscape		(const
libxml-xmlstring.html#xmlChar
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 25 May 2001 Uses
libxml-uri.html#xmlParseURI
xmlParseURI
and
libxml-uri.html#xmlURIEscapeStr
xmlURIEscapeStr
to try to escape correctly according to RFC2396. - Carl Douglas
Function: xmlURIEscapeStr
libxml-xmlstring.html#xmlChar
xmlChar
*	xmlURIEscapeStr		(const
libxml-xmlstring.html#xmlChar
xmlChar
* str,
const
libxml-xmlstring.html#xmlChar
xmlChar
* list)
This routine escapes a string to hex, ignoring reserved
libxml-SAX.html#characters
characters
(a-z) and the
libxml-SAX.html#characters
characters
in the exception list.
str
:
string to escape
list
:
exception list string of chars not to escape
Returns
:
a new escaped string or NULL in case of error.
Function: 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 length in bytes to unescape (or <= 0 to indicate full string)
target
:
optional destination buffer
Returns
:
an copy of the string, but unescaped
../bugs.html
Daniel Veillard
