# Minimal name expansion

**URL:** <https://discourse.citationstyles.org/t/minimal-name-expansion/588>\
**Category:** CSL Development\
**Created:** [March 30, 2009, 2:44pm UTC](https://discourse.citationstyles.org/t/minimal-name-expansion/588 "2009-03-30T14:44:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frank\_Bennett](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/frank_bennett/32/198_2.png) [@Frank\_Bennett](https://discourse.citationstyles.org/u/Frank_Bennett)\
**Post date:** [March 30, 2009, 2:44pm UTC](https://discourse.citationstyles.org/t/minimal-name-expansion/588/1 "2009-03-30T14:44:15Z")

</div>

Here is a testing sample for minimal name expansion. Passes in  
citeproc-js, to my own amazement.

Data:  
[http://xbiblio.svn.sourceforge.net/viewvc/xbiblio/citeproc-js/branches/fbennett/std/items/ambigs-4.txt?revision=831&view=markup](http://xbiblio.svn.sourceforge.net/viewvc/xbiblio/citeproc-js/branches/fbennett/std/items/ambigs-4.txt?revision=831&view=markup)  
[http://xbiblio.svn.sourceforge.net/viewvc/xbiblio/citeproc-js/branches/fbennett/std/items/ambigs-5.txt?revision=831&view=markup](http://xbiblio.svn.sourceforge.net/viewvc/xbiblio/citeproc-js/branches/fbennett/std/items/ambigs-5.txt?revision=831&view=markup)

Test:  
[http://xbiblio.svn.sourceforge.net/viewvc/xbiblio/citeproc-js/branches/fbennett/std/tests/names/test029.txt?revision=843&view=markup](http://xbiblio.svn.sourceforge.net/viewvc/xbiblio/citeproc-js/branches/fbennett/std/tests/names/test029.txt?revision=843&view=markup)

Frank

---

<div class="post-metadata">

**Author:** ![Andrea\_Rossato1](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@Andrea\_Rossato1](https://discourse.citationstyles.org/u/Andrea_Rossato1)\
**Post date:** [March 30, 2009, 5:19pm UTC](https://discourse.citationstyles.org/t/minimal-name-expansion/588/2 "2009-03-30T17:19:25Z")

</div>

I tried them, and tried to break citeproc-js: it seems like you are  
doing a great job.

I’m going to implement your test suite for -hs too. Just one question:  
what kind of output do you expect when it comes to formatting? I saw a  
few HTML tags…

Andrea

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [March 30, 2009, 6:09pm UTC](https://discourse.citationstyles.org/t/minimal-name-expansion/588/3 "2009-03-30T18:09:15Z")

</div>

I’d also like to raise another issue I’ve raised before: namespaces. A  
correct XML parser will not understand the CSL fragments in the tests  
as valid. E.g.,using Python lxml library (which is an etree-compatible  
API on top of libxml), an expression like  
csl.find(’/style/info/title’) will return nothing. Where a library  
does return something, that’s effectively bug (if a convenient one).

So shouldn’t the test fragments be properly namespaced?

Bruce

---

<div class="post-metadata">

**Author:** ![Frank\_Bennett](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/frank_bennett/32/198_2.png) [@Frank\_Bennett](https://discourse.citationstyles.org/u/Frank_Bennett)\
**Post date:** [March 30, 2009, 9:09pm UTC](https://discourse.citationstyles.org/t/minimal-name-expansion/588/4 "2009-03-30T21:09:07Z")

</div>

> > > Here is a testing sample for minimal name expansion. Passes in  
> > > citeproc-js, to my own amazement.
> > 
> > I tried them, and tried to break citeproc-js: it seems like you are  
> > doing a great job.
> > 
> > I’m going to implement your test suite for -hs too. Just one question:  
> > what kind of output do you expect when it comes to formatting? I saw a  
> > few HTML tags…
> 
> I’d also like to raise another issue I’ve raised before: namespaces. A  
> correct XML parser will not understand the CSL fragments in the tests  
> as valid. E.g.,using Python lxml library (which is an etree-compatible  
> API on top of libxml), an expression like  
> csl.find(‘/style/info/title’) will return nothing. Where a library  
> does return something, that’s effectively bug (if a convenient one).
> 
> So shouldn’t the test fragments be properly namespaced?

They are wrapped in style and citation elements before rendering, so a  
namespaced object does reach the processor. Would it be enough to  
document that?

Now that you mention it, though, there does need to be a change to the  
file syntax. Instead of “csl”, it should be “locale”, “macro”,  
“citation” and “bibliography”. That would also help make it clear  
that there’s a template behind the fragments. Or we could just  
include the whole object in the test. Which is preferable? I’m easy,  
I’ll just wait for guidance before refactoring the files.

Frank

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [March 30, 2009, 10:36pm UTC](https://discourse.citationstyles.org/t/minimal-name-expansion/588/5 "2009-03-30T22:36:01Z")

</div>

…

> > So shouldn’t the test fragments be properly namespaced?
> 
> They are wrapped in style and citation elements before rendering, so a  
> namespaced object does reach the processor. Would it be enough to  
> document that?
> 
> Now that you mention it, though, there does need to be a change to the  
> file syntax. Instead of “csl”, it should be “locale”, “macro”,  
> “citation” and “bibliography”. That would also help make it clear  
> that there’s a template behind the fragments. Or we could just  
> include the whole object in the test. Which is preferable? I’m easy,  
> I’ll just wait for guidance before refactoring the files.

What do mean by the “template behind the fragments” and the “wrapped  
… before rendering” comments? That you literally do that as part of  
the fixture construction?

Also, by “whole object” are you referring to the complete CSL file?

Bruce

---

<div class="post-metadata">

**Author:** ![Frank\_Bennett](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/frank_bennett/32/198_2.png) [@Frank\_Bennett](https://discourse.citationstyles.org/u/Frank_Bennett)\
**Post date:** [March 30, 2009, 11:30pm UTC](https://discourse.citationstyles.org/t/minimal-name-expansion/588/6 "2009-03-30T23:30:22Z")

</div>

> …
> 
> > > So shouldn’t the test fragments be properly namespaced?
> > 
> > They are wrapped in style and citation elements before rendering, so a  
> > namespaced object does reach the processor. Would it be enough to  
> > document that?
> > 
> > Now that you mention it, though, there does need to be a change to the  
> > file syntax. Instead of “csl”, it should be “locale”, “macro”,  
> > “citation” and “bibliography”. That would also help make it clear  
> > that there’s a template behind the fragments. Or we could just  
> > include the whole object in the test. Which is preferable? I’m easy,  
> > I’ll just wait for guidance before refactoring the files.
> 
> What do mean by the “template behind the fragments” and the “wrapped  
> … before rendering” comments? That you literally do that as part of  
> the fixture construction?

Yes, at the moment there is a template that works something like this:

%%CSL%%

But I think you’re right, the test should provide the full namespaced  
CSL object, for clarity. It saved some typing to use a template, but  
it’s not transparent enough and requires too much pre-processing for  
standard tests. Shall I refactor things? It’s easy to do.

> Also, by “whole object” are you referring to the complete CSL file?

Yes.

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [March 31, 2009, 1:22pm UTC](https://discourse.citationstyles.org/t/minimal-name-expansion/588/7 "2009-03-31T13:22:42Z")

</div>

…

> But I think you’re right, the test should provide the full namespaced  
> CSL object, for clarity. It saved some typing to use a template, but  
> it’s not transparent enough and requires too much pre-processing for  
> standard tests. Shall I refactor things? It’s easy to do.

Yes, please do. As you say, it’s more transparent.

Bruce

---

<div class="post-metadata">

**Author:** ![Frank\_Bennett](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/frank_bennett/32/198_2.png) [@Frank\_Bennett](https://discourse.citationstyles.org/u/Frank_Bennett)\
**Post date:** [March 31, 2009, 3:46pm UTC](https://discourse.citationstyles.org/t/minimal-name-expansion/588/8 "2009-03-31T15:46:05Z")

</div>

> …
> 
> > But I think you’re right, the test should provide the full namespaced  
> > CSL object, for clarity. It saved some typing to use a template, but  
> > it’s not transparent enough and requires too much pre-processing for  
> > standard tests. Shall I refactor things? It’s easy to do.
> 
> Yes, please do. As you say, it’s more transparent.

Done.

---

<div class="post-metadata">

**Author:** ![Rintze\_Zelle](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/rintze_zelle/32/175_2.png) [@Rintze\_Zelle](https://discourse.citationstyles.org/u/Rintze_Zelle)\
**Post date:** [March 31, 2009, 3:50pm UTC](https://discourse.citationstyles.org/t/minimal-name-expansion/588/9 "2009-03-31T15:50:10Z")

</div>

Now that CSL 0.8 has been tagged, I have a question related to namespaces.  
Are there any backward incompatible changes planned for CSL 1.0? If so, is  
it correct to keep the namespace in all styles pointing to “  
[http://purl.org/net/xbiblio/csl](http://purl.org/net/xbiblio/csl)”? Shouldn’t styles in that case name the  
CSL-version for which they are validated (e.g. all the current styles in the  
Zotero Style Repository could point to CSL 0.8)?

Rintze

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [March 31, 2009, 4:00pm UTC](https://discourse.citationstyles.org/t/minimal-name-expansion/588/10 "2009-03-31T16:00:15Z")

</div>

> Now that CSL 0.8 has been tagged, I have a question related to namespaces.  
> Are there any backward incompatible changes planned for CSL 1.0?

Probably some minor ones.

> If so, is it correct to keep the namespace in all styles pointing to  
> “[Citation Style Language - Citation Style Language](http://purl.org/net/xbiblio/csl)”? Shouldn’t styles in that case name the  
> CSL-version for which they are validated (e.g. all the current styles in the  
> Zotero Style Repository could point to CSL 0.8)?

I think it depends. The problem with using namespaces to version is  
that you then require code be updated across the board to handle those  
different namespaces. From an XML perspective, they are effectively  
different schemas.

There’s two other approaches to versioning:

1. the “don’t worry about it approach”; only works in this case if ALL  
implementations agree to it and figure out how to handle upgrading

2. add something like a schema version attribute to the root, so that  
a tool knows which schema version to use for validation, and then for  
parsing

I guess my vote would be to try to see if we can take the #1 approach  
to get us to 1.0, and then use #2 beyond that (hoping we don’t have to  
introduce any significant changes later).

But we should add this to the list of issues to resolve.

One of the Mendeley devs joined this list, BTW, but he’s busy  
squashing bugs for a new release. We need their input on this, suffice  
to say.

Bruce2009/3/31 Rintze Zelle \<@Rintze\_Zelle\>:
