Template Parsing Issue

While creating a new footnote template, I think I found a parsing bug. Given the following template:

“[Database],” database with images, Ancestry ([URL] : <[AccessType]|accessed> [AccessDate]) [ImagePath] > image [ImageNum] of [ImageCount] > [Person]: registration card, <serial no. [SerialNum], >Local Draft Board: [DraftCity] ([DraftCounty] County), [DraftState]; citing NARA microfilmed publication M1509.

The simple switch <serial no. [SerialNum], > does not work correctly. The opening and closing angle brackets appear in the created citation as shown below:

“U.S., World War I Draft Registration Cards, 1917-1918,” database with images, Ancestry (www.ancestry.com/search/collections/6482 : accessed 22 February 2015) > Illinois > Iroquois > ALL > C > image 194 of 454 > Dewey William Castongia: registration card, <serial no. 3568, >Local Draft Board: Watseka (Iroquois County), Illinois; citing NARA microfilmed publication M1509.

If the [SerialNum] field is empty it still shows <serial no. ,> in the output.

Removing the two right angle brackets following the [ImagePath] and [ImageCount] fields fixes the switch.

“[Database],” database with images, Ancestry ([URL] : <[AccessType]|accessed> [AccessDate]) [ImagePath] image [ImageNum] of [ImageCount] [Person]: registration card, <serial no. [SerialNum], >Local Draft Board: [DraftCity] ([DraftCounty] County), [DraftState]; citing NARA microfilmed publication M1509.

But now the output is incorrect:

“U.S., World War I Draft Registration Cards, 1917-1918,” database with images, Ancestry (www.ancestry.com/search/collections/6482 : accessed 22 February 2015) > Illinois > Iroquois > ALL > C image 194 of 454 Dewey William Castongia: registration card, serial no. 3568, Local Draft Board: Watseka (Iroquois County), Illinois; citing NARA microfilmed publication M1509.

I also tried removing the <[AccessType]|accessed> switch but that didn’t make a difference in the [SerialNum] switch.

Thanks

Angle brackets need to be paired i.e. . In the above [ImagePath] > and [ImageCount] > are missing matching/opening brackets. I am not sure of your intention with that section of the statement but…

Does this fix the logic:

“[Database],” database with images, Ancestry <<([URL] : <[AccessType]|accessed> [AccessDate]) [ImagePath] > image [ImageNum] of [ImageCount] > [Person]: registration card, <serial no. [SerialNum], >Local Draft Board: [DraftCity] ([DraftCounty] County), [DraftState]; citing NARA microfilmed publication M1509.

or without nesting

“[Database],” database with images, Ancestry ([URL] : <[AccessType]|accessed> [AccessDate]) <[ImagePath] > image [ImageNum] of <[ImageCount] > [Person]: registration card, <serial no. [SerialNum], >Local Draft Board: [DraftCity] ([DraftCounty] County), [DraftState]; citing NARA microfilmed publication M1509.

or

“[Database],” database with images, Ancestry ([URL] : <[AccessType]|accessed> [AccessDate]) [ImagePath] image [ImageNum] of [ImageCount] [Person]: registration card, <serial no. [SerialNum], >Local Draft Board: [DraftCity] ([DraftCounty] County), [DraftState]; citing NARA microfilmed publication M1509.

this one as per your edit but where did the >s come from? Somewhere a missing statement update?

or

“[Database],” database with images, Ancestry ([URL] : <[AccessType]|accessed> [AccessDate]) <[ImagePath] ><image [ImageNum] ><of [ImageCount] >[Person]: registration card, <serial no. [SerialNum], >Local Draft Board: [DraftCity] ([DraftCounty] County), [DraftState]; citing NARA microfilmed publication M1509.

or…

Needs a hands on but as is will not work until the missing <'s are in or unpaired >'s taken out.

1 Like

As has already been pointed out, the angle brackets in RM’s template language are like parentheses in many computer languages in that they need to be paired. Here you have a right angle bracket that is not preceded by its own left angle bracket.

I would only add that just like parentheses in many computer languages that can be nested, the angle brackets in RM’s template language can be nested more than one level deep. In my experience, it is seldom necessary to do so, but the feature exists in case it is needed. But even with (or especially with) nested angle brackets, each left angle bracket has to be paired with a right angle bracket and vice versa.

I’ve been slowing migrating away from the sources that were imported from The Master Genealogist and switching to Evidence Explained (EE) v4 patterns. In this case, the arrows are used as separators between the steps to directly find the document image in the Ancestry database.

This is what the correct source should look like:

“U.S., World War I Draft Registration Cards, 1917-1918,” database with images, Ancestry (www.ancestry.com/search/collections/6482 : accessed 22 February 2015) > Illinois > Iroquois > ALL > C > image 194 of 454 > Dewey William Castongia: registration card, serial no. 3568, Local Draft Board: Watseka (Iroquois County), Illinois; citing NARA microfilmed publication M1509.

None of your suggestions quite worked but I had forgotten about the template language escape character. Proceeding the bracket with a forward slash will print the character and not treat it as a switch.

With escape characters the source template now works correctly:

“[Database],” database with images, Ancestry ([URL] : <[AccessType]|accessed> [AccessDate]) [ImagePath] /> image [ImageNum] of [ImageCount] /> [Person]: registration card, <serial no. [SerialNum], >Local Draft Board: [DraftCity] ([DraftCounty] County), [DraftState]; citing NARA microfilmed publication M1509.

Thanks