I'm no expert but here is my reading: It's not a substitution as such but how to build the "secondary-contributors" macro - the author is not touched.
The "<if variable="author">" means if currently dealing with an author (from where the macro is called) then add the editor to the list (of secondary-contributors) The "<if variable="author editor" match="any">" means if currently dealing with an author OR editor (from where the macro is called) then add the translator to the list (of secondary-contributors). So when "secondary-contributors" is used with an author, it will then have his editor and translator (where present and in that order) to output. When "secondary-contributors" is used with an editor, it will have his translator (where present) to output. Cheers Simon -----Original Message----- From: jda [mailto:[email protected]] Sent: 22 January 2013 14:36 To: [email protected] Subject: [xbiblio-devel] Understanding Choose by variable I'm toying with writing a CSL parser and have found this to be rather difficult. I've been able to deal with relatively simple styles, like JBC, but find the more complex ones baffling. For example, the Chicago styles. Here's one macro from the Chicago Author-Date style: <macro name="secondary-contributors"> <choose> <if type="chapter paper-conference" match="none"> <group delimiter=". "> <choose> <if variable="author"> <names variable="editor"> <label form="verb" text-case="capitalize-first" suffix=" " plural="never"/> <name and="text" delimiter=", "/> </names> </if> </choose> <choose> <if variable="author editor" match="any"> <names variable="translator"> <label form="verb" text-case="capitalize-first" suffix=" " plural="never"/> <name and="text" delimiter=", "/> </names> </if> </choose> </group> </if> </choose> </macro> Could someone translate the logic of this macro into English for me? The <if type= node is self-explanatory. However, what does <if variable="author"> mean? To me it would seem to mean if type is a chapter or paper-conference if an author is to be output substitute the editor but that makes no sense. Also, what does <if variable="author editor" match="any"> mean? I appreciate any explanation someone on the list can give. Thanks, Jon ---------------------------------------------------------------------------- -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d _______________________________________________ xbiblio-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/xbiblio-devel ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d _______________________________________________ xbiblio-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/xbiblio-devel
