From 4038ab95a094b363f1748f3dcb51511a1217475d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 07:40:05 +0200 Subject: Adding upstream version 2.0.16. Signed-off-by: Daniel Baumann --- .../tutorial-serializer-declare-namespace.html | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 docs/html/tutorial-serializer-declare-namespace.html (limited to 'docs/html/tutorial-serializer-declare-namespace.html') diff --git a/docs/html/tutorial-serializer-declare-namespace.html b/docs/html/tutorial-serializer-declare-namespace.html new file mode 100644 index 0000000..05b01da --- /dev/null +++ b/docs/html/tutorial-serializer-declare-namespace.html @@ -0,0 +1,63 @@ + + + + +Declare namespaces: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Declare namespaces

+

Raptor can use namespace prefix/URIs to abbreviate syntax +in some syntaxes such as Turtle or any XML syntax including RDF/XML, +RSS1.0 and Atom 1.0. These are declared +with raptor_serializer_set_namespace() +using a prefix and URI argument pair like this: +

+
+  const unsigned char* prefix = "ex";
+  raptor_uri* uri = raptor_new_uri(world, "http://example.org");
+
+  raptor_serializer_set_namespace(rdf_serializer, prefix, uri);
+
+

+

+

or +raptor_serializer_set_namespace_from_namespace() +from an existing namespace. This can be useful when connected up the +the namespace declarations that are generated from a parser via a +namespace handler set with +raptor_parser_set_namespace_handler() +

+like this: +
+  static void
+  relay_namespaces(void* user_data, raptor_namespace *nspace)
+  {
+    raptor_serializer_set_namespace_from_namespace(rdf_serializer, nspace);
+  }
+
+  ...
+
+  rdf_parser = raptor_new_parser(world, syntax_name);
+  raptor_parser_set_namespace_handler(rdf_parser, rdf_serializer, relay_namespaces);
+
+
+ + + \ No newline at end of file -- cgit v1.2.3