MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / StartNamespaceDeclHandler

Function StartNamespaceDeclHandler

xmpsdk/src/ExpatAdapter.cpp:241–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239// =================================================================================================
240
241static void StartNamespaceDeclHandler ( void * userData, XMP_StringPtr prefix, XMP_StringPtr uri )
242{
243 IgnoreParam(userData);
244
245 // As a bug fix hack, change a URI of "http://purl.org/dc/1.1/" to ""http://purl.org/dc/elements/1.1/.
246 // Early versions of Flash that put XMP in SWF used a bad URI for the dc: namespace.
247
248 #if XMP_DebugBuild & DumpXMLParseEvents // Avoid unused variable warning.
249 ExpatAdapter * thiz = (ExpatAdapter*)userData;
250 #endif
251
252 if ( prefix == 0 ) prefix = "_dflt_"; // Have default namespace.
253 if ( uri == 0 ) return; // Ignore, have xmlns:pre="", no URI to register.
254
255 #if XMP_DebugBuild & DumpXMLParseEvents
256 if ( thiz->parseLog != 0 ) {
257 PrintIndent ( thiz->parseLog, thiz->elemNesting );
258 fprintf ( thiz->parseLog, "StartNamespace: %s - \"%s\"\n", prefix, uri );
259 }
260 #endif
261
262 if ( XMP_LitMatch ( uri, "http://purl.org/dc/1.1/" ) ) uri = "http://purl.org/dc/elements/1.1/";
263 XMPMeta::RegisterNamespace ( uri, prefix );
264
265} // StartNamespaceDeclHandler
266
267// =================================================================================================
268

Callers

nothing calls this directly

Calls 1

PrintIndentFunction · 0.85

Tested by

no test coverage detected