From 63a9509a711daa47cf99158c6bd135d0d79eb9e4 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 31 Jul 2003 10:33:36 +0000 Subject: [PATCH] Each tag has now a unique name, e.g. . Modified the DTD accordingly. Figured out how libexpat likes the tag. --- doc/matroska-tags.xml | 16 ++-- doc/matroskatags.dtd | 164 ++++++++++++++++++++-------------------- src/tagparser_end.cpp | 12 +-- src/tagparser_start.cpp | 12 +-- src/tagwriter.cpp | 12 +-- 5 files changed, 110 insertions(+), 106 deletions(-) diff --git a/doc/matroska-tags.xml b/doc/matroska-tags.xml index 13f465c73..e68740ca6 100644 --- a/doc/matroska-tags.xml +++ b/doc/matroska-tags.xml @@ -1,6 +1,6 @@ - + @@ -71,7 +71,7 @@ - 1 + 1
Address
URL Email @@ -86,7 +86,7 @@ - 2 + 2 2003-07-18T20:00:00+0100 2003-07-18T20:00:00+0000 @@ -94,7 +94,7 @@ - 3 + 3 Name URL Email @@ -104,7 +104,7 @@ - 4 + 4 - <Type>3</Type> + <TitleType>3</TitleType> <Name>Name2</Name> <SubTitle>SubTitle2</SubTitle> <Edition>Edition2</Edition> diff --git a/doc/matroskatags.dtd b/doc/matroskatags.dtd index b365a1765..8e1fb9d57 100644 --- a/doc/matroskatags.dtd +++ b/doc/matroskatags.dtd @@ -1,5 +1,5 @@ -<!element Tags (Tag*)> -<!element Tag ( +<!ELEMENT Tags (Tag*)> +<!ELEMENT Tag ( Targets, General?, Genres?, @@ -13,14 +13,14 @@ MultiTitle?, MultiComment*)> -<!element Targets ( +<!ELEMENT Targets ( TrackUID*, ChapterUID*, MultiComment*)> -<!element TrackUID (#PCDATA)> -<!element ChapterUID (#PCDATA)> +<!ELEMENT TrackUID (#PCDATA)> +<!ELEMENT ChapterUID (#PCDATA)> -<!element General ( +<!ELEMENT General ( Subject?, Bibliography?, Language?, @@ -39,34 +39,34 @@ PlayCounter?, Popularimeter?, MultiComment*)> -<!element Subject (#PCDATA)> -<!element Biography (#PCDATA)> -<!element Language (#PCDATA)> -<!element Rating (#PCDATA)> -<!element Encoder (#PCDATA)> -<!element EncodeSettings (#PCDATA)> -<!element File (#PCDATA)> -<!element ArchivalLocation (#PCDATA)> -<!element Keywords (#PCDATA)> -<!element Mood (#PCDATA)> -<!element RecordLocation (#PCDATA)> -<!element Source (#PCDATA)> -<!element SourceForm (#PCDATA)> -<!element Product (#PCDATA)> -<!element OriginalMediaType (#PCDATA)> -<!element PlayCounter (#PCDATA)> -<!element Popularimeter (#PCDATA)> +<!ELEMENT Subject (#PCDATA)> +<!ELEMENT Biography (#PCDATA)> +<!ELEMENT Language (#PCDATA)> +<!ELEMENT Rating (#PCDATA)> +<!ELEMENT Encoder (#PCDATA)> +<!ELEMENT EncodeSettings (#PCDATA)> +<!ELEMENT File (#PCDATA)> +<!ELEMENT ArchivalLocation (#PCDATA)> +<!ELEMENT Keywords (#PCDATA)> +<!ELEMENT Mood (#PCDATA)> +<!ELEMENT RecordLocation (#PCDATA)> +<!ELEMENT Source (#PCDATA)> +<!ELEMENT SourceForm (#PCDATA)> +<!ELEMENT Product (#PCDATA)> +<!ELEMENT OriginalMediaType (#PCDATA)> +<!ELEMENT PlayCounter (#PCDATA)> +<!ELEMENT Popularimeter (#PCDATA)> -<!element Genres ( +<!ELEMENT Genres ( AudioGenre*, VideoGenre*, SubGenre?, MultiComment*)> -<!element AudioGenre (#PCDATA)> -<!element VideoGenre (#PCDATA)> -<!element SubGenre (#PCDATA)> +<!ELEMENT AudioGenre (#PCDATA)> +<!ELEMENT VideoGenre (#PCDATA)> +<!ELEMENT SubGenre (#PCDATA)> -<!element AudioSpecific ( +<!ELEMENT AudioSpecific ( AudioEncryption?, AudioGain?, AudioPeak?, @@ -78,18 +78,18 @@ OfficialAudioFileURL?, OfficialAudioSourceURL?, MultiComment*)> -<!element AudioEncryption (#PCDATA)> -<!element AudioGain (#PCDATA)> -<!element AudioPeak (#PCDATA)> -<!element BPM (#PCDATA)> -<!element Equalisation (#PCDATA)> -<!element DiscTrack (#PCDATA)> -<!element SetPart (#PCDATA)> -<!element InitialKey (#PCDATA)> -<!element OfficialAudioFileURL (#PCDATA)> -<!element OfficialAudioSourceURL (#PCDATA)> +<!ELEMENT AudioEncryption (#PCDATA)> +<!ELEMENT AudioGain (#PCDATA)> +<!ELEMENT AudioPeak (#PCDATA)> +<!ELEMENT BPM (#PCDATA)> +<!ELEMENT Equalisation (#PCDATA)> +<!ELEMENT DiscTrack (#PCDATA)> +<!ELEMENT SetPart (#PCDATA)> +<!ELEMENT InitialKey (#PCDATA)> +<!ELEMENT OfficialAudioFileURL (#PCDATA)> +<!ELEMENT OfficialAudioSourceURL (#PCDATA)> -<!element ImageSpecific ( +<!ELEMENT ImageSpecific ( CaptureDPI?, CaptureLightness?, CapturePaletteSetting?, @@ -97,74 +97,77 @@ Cropped?, OriginalDimensions, MultiComment*)> -<!element CaptureDPI (#PCDATA)> -<!element CaptureLightness (#PCDATA)> -<!element CapturePaletteSetting (#PCDATA)> -<!element CaptureSharpness (#PCDATA)> -<!element Cropped (#PCDATA)> -<!element OriginalDimensions (#PCDATA)> +<!ELEMENT CaptureDPI (#PCDATA)> +<!ELEMENT CaptureLightness (#PCDATA)> +<!ELEMENT CapturePaletteSetting (#PCDATA)> +<!ELEMENT CaptureSharpness (#PCDATA)> +<!ELEMENT Cropped (#PCDATA)> +<!ELEMENT OriginalDimensions (#PCDATA)> -<!element MultiCommercial (Commercial+)> -<!element Commercial( - Type, +<!ELEMENT MultiCommercial (Commercial+)> +<!ELEMENT Commercial( + CommercialType, Address?, URL*, Email*, MultiPrice*, MultiComment*)> -<!element Type (#PCDATA)> -<!element Address (#PCDATA)> -<!element URL (#PCDATA)> -<!element Email (#PCDATA)> -<!element MultiPrice ( +<!ELEMENT CommercialType (#PCDATA)> +<!ELEMENT Address (#PCDATA)> +<!ELEMENT URL (#PCDATA)> +<!ELEMENT Email (#PCDATA)> +<!ELEMENT MultiPrice ( Currency?, Amount?, PriceDate?, MultiComment*)> -<!element Currency (#PCDATA)> -<!element Amount (#PCDATA)> -<!element PriceDate (#PCDATA)> +<!ELEMENT Currency (#PCDATA)> +<!ELEMENT Amount (#PCDATA)> +<!ELEMENT PriceDate (#PCDATA)> -<!element MultiDate (Date+)> -<!element Date ( - Type, +<!ELEMENT MultiDate (Date+)> +<!ELEMENT Date ( + DateType, Begin?, End?, MultiComment*)> -<!element Begin (#PCDATA)> -<!element End (#PCDATA)> +<!ELEMENT DateType (#PCDATA)> +<!ELEMENT Begin (#PCDATA)> +<!ELEMENT End (#PCDATA)> -<!element MultiEntity (Entity+)> -<!element Entity ( +<!ELEMENT MultiEntity (Entity+)> +<!ELEMENT Entity ( EntityType, Name?, URL*, Email*, Address?, MultiComment*)> -<!element EntityType (#PCDATA)> -<!element Name (#PCDATA)> +<!ELEMENT EntityType (#PCDATA)> +<!ELEMENT Name (#PCDATA)> -<!element MultiIdentifier (Identifier+)> -<!element Identifier ( - Type, +<!ELEMENT MultiIdentifier (Identifier+)> +<!ELEMENT Identifier ( + IdentifierType, Binary?, String?, MultiComment*)> -<!element Binary (#PCDATA)> -<!element String (#PCDATA)> +<!ELEMENT IdentifierType (#PCDATA)> +<!ELEMENT Binary (#PCDATA)> +<!ELEMENT String (#PCDATA)> -<!element MultiLegal (Legal+)> -<!element Legal ( - Type, +<!ELEMENT MultiLegal (Legal+)> +<!ELEMENT Legal ( + LegalType, URL*, Address?, Content?, MultiComment*)> -<!element Content (#PCDATA)> +<!ELEMENT LegalType (#PCDATA)> +<!ELEMENT Content (#PCDATA)> -<!element MultiTitle (Title+)> -<!element Title ( +<!ELEMENT MultiTitle (Title+)> +<!ELEMENT Title ( TitleType, Name?, SubTitle?, @@ -174,11 +177,12 @@ Email*, Language?, MultiComment*)> -<!element SubTitle (#PCDATA)> -<!element Edition (#PCDATA)> +<!ELEMENT TitleType (#PCDATA)> +<!ELEMENT SubTitle (#PCDATA)> +<!ELEMENT Edition (#PCDATA)> -<!element MultiComment ( +<!ELEMENT MultiComment ( Name?, Comments, Language?)> -<!element Comments (#PCDATA)> +<!ELEMENT Comments (#PCDATA)> diff --git a/src/tagparser_end.cpp b/src/tagparser_end.cpp index e6d1f2a96..c4bd7e30b 100644 --- a/src/tagparser_end.cpp +++ b/src/tagparser_end.cpp @@ -479,7 +479,7 @@ static void end_level4(parser_data_t *pdata, const char *name) { parent = (*pdata->parents)[pdata->parents->size() - 2]; if (parent == E_Commercial) { - if (!strcmp(name, "Type")) + if (!strcmp(name, "CommercialType")) el_get_uint(pdata, &GetChild<KaxTagMultiCommercialType> (*pdata->commercial), 1); else if (!strcmp(name, "Address")) @@ -494,7 +494,7 @@ static void end_level4(parser_data_t *pdata, const char *name) { } } else if (parent == E_Date) { - if (!strcmp(name, "Type")) + if (!strcmp(name, "DateType")) el_get_uint(pdata, &GetChild<KaxTagMultiDateType> (*pdata->date), 1); else if (!strcmp(name, "Begin")) @@ -505,7 +505,7 @@ static void end_level4(parser_data_t *pdata, const char *name) { (*pdata->date)); } else if (parent == E_Entity) { - if (!strcmp(name, "Type")) + if (!strcmp(name, "EntityType")) el_get_uint(pdata, &GetChild<KaxTagMultiEntityType> (*pdata->entity), 1); else if (!strcmp(name, "Name")) @@ -520,7 +520,7 @@ static void end_level4(parser_data_t *pdata, const char *name) { (*pdata->entity)); } else if (parent == E_Identifier) { - if (!strcmp(name, "Type")) + if (!strcmp(name, "IdentifierType")) el_get_uint(pdata, &GetChild<KaxTagMultiIdentifierType> (*pdata->identifier), 1); else if (!strcmp(name, "Binary")) @@ -531,7 +531,7 @@ static void end_level4(parser_data_t *pdata, const char *name) { (*pdata->identifier)); } else if (parent == E_Legal) { - if (!strcmp(name, "Type")) + if (!strcmp(name, "LegalType")) el_get_uint(pdata, &GetChild<KaxTagMultiLegalType> (*pdata->legal), 1); else if (!strcmp(name, "URL")) @@ -544,7 +544,7 @@ static void end_level4(parser_data_t *pdata, const char *name) { (*pdata->legal)); } else if (parent == E_Title) { - if (!strcmp(name, "Type")) + if (!strcmp(name, "TitleType")) el_get_uint(pdata, &GetChild<KaxTagMultiTitleType> (*pdata->title), 1); else if (!strcmp(name, "Name")) diff --git a/src/tagparser_start.cpp b/src/tagparser_start.cpp index 4d7b4f52b..f3389dc33 100644 --- a/src/tagparser_start.cpp +++ b/src/tagparser_start.cpp @@ -540,7 +540,7 @@ static void start_level4(parser_data_t *pdata, const char *name) { pdata->data_allowed = true; - if (!strcmp(name, "Type")) { + if (!strcmp(name, "CommercialType")) { check_instances(pdata->commercial, KaxTagMultiCommercialType); pdata->parents->push_back(E_CommercialType); } else if (!strcmp(name, "Address")) { @@ -582,7 +582,7 @@ static void start_level4(parser_data_t *pdata, const char *name) { pdata->data_allowed = true; - if (!strcmp(name, "Type")) { + if (!strcmp(name, "DateType")) { check_instances(pdata->date, KaxTagMultiDateType); pdata->parents->push_back(E_DateType); } else if (!strcmp(name, "Begin")) { @@ -600,7 +600,7 @@ static void start_level4(parser_data_t *pdata, const char *name) { pdata->data_allowed = true; - if (!strcmp(name, "Type")) { + if (!strcmp(name, "EntityType")) { check_instances(pdata->entity, KaxTagMultiEntityType); pdata->parents->push_back(E_EntityType); } else if (!strcmp(name, "Name")) { @@ -635,7 +635,7 @@ static void start_level4(parser_data_t *pdata, const char *name) { pdata->data_allowed = true; - if (!strcmp(name, "Type")) { + if (!strcmp(name, "IdentifierType")) { check_instances(pdata->identifier, KaxTagMultiIdentifierType); pdata->parents->push_back(E_IdentifierType); } else if (!strcmp(name, "Binary")) { @@ -653,7 +653,7 @@ static void start_level4(parser_data_t *pdata, const char *name) { pdata->data_allowed = true; - if (!strcmp(name, "Type")) { + if (!strcmp(name, "LegalType")) { check_instances(pdata->legal, KaxTagMultiLegalType); pdata->parents->push_back(E_LegalType); } else if (!strcmp(name, "URL")) { @@ -679,7 +679,7 @@ static void start_level4(parser_data_t *pdata, const char *name) { pdata->data_allowed = true; - if (!strcmp(name, "Type")) { + if (!strcmp(name, "TitleType")) { check_instances(pdata->title, KaxTagMultiTitleType); pdata->parents->push_back(E_TitleType); } else if (!strcmp(name, "Name")) { diff --git a/src/tagwriter.cpp b/src/tagwriter.cpp index 6197e9171..a58a735b4 100644 --- a/src/tagwriter.cpp +++ b/src/tagwriter.cpp @@ -156,7 +156,7 @@ static void handle_level4(EbmlElement *e) { int i, level = 4; if (is_id(KaxTagMultiCommercialType)) - pr_ui("Type"); + pr_ui("CommercialType"); else if (is_id(KaxTagMultiCommercialAddress)) pr_us("Address"); @@ -174,7 +174,7 @@ static void handle_level4(EbmlElement *e) { mxprint(o, " </MultiPrice>\n"); } else if (is_id(KaxTagMultiDateType)) - pr_ui("Type"); + pr_ui("DateType"); else if (is_id(KaxTagMultiDateDateBegin)) pr_d("Begin"); @@ -183,7 +183,7 @@ static void handle_level4(EbmlElement *e) { pr_d("End"); else if (is_id(KaxTagMultiEntityType)) - pr_ui("Type"); + pr_ui("EntityType"); else if (is_id(KaxTagMultiEntityName)) pr_us("Name"); @@ -207,7 +207,7 @@ static void handle_level4(EbmlElement *e) { pr_us("String"); else if (is_id(KaxTagMultiLegalType)) - pr_ui("Type"); + pr_ui("LegalType"); else if (is_id(KaxTagMultiLegalURL)) pr_s("URL"); @@ -219,7 +219,7 @@ static void handle_level4(EbmlElement *e) { pr_us("Content"); else if (is_id(KaxTagMultiTitleType)) - pr_ui("Type"); + pr_ui("TitleType"); else if (is_id(KaxTagMultiTitleName)) pr_us("Name"); @@ -379,7 +379,7 @@ static void handle_level3(EbmlElement *e) { mxprint(o, " <Entity>\n"); for (i = 0; i < ((EbmlMaster *)e)->ListSize(); i++) handle_level4((*(EbmlMaster *)e)[i]); - mxprint(o, " </Enetity>\n"); + mxprint(o, " </Entity>\n"); } else if (is_id(KaxTagIdentifier)) { mxprint(o, " <Identifier>\n");