is-numeric
Hello,
I encounter a problem with the use of "is-numeric".
I naively thought that only numerals would be considered as numeric. I had the bad surprise to discover that it was far larger than that, and not easy to understand.
By example, an issue, entered as "14 - Du Dialogue", becomes "n° 14". The non-numeric part is lost.
For edition, volume, issue, it is very common to use mixed fields.
I would need a test on "strictly numeric".
If the field is "strictly numeric", we want to add a fixed prefix or suffix, if not strictly numeric, we want to take it as it is.
Is there any information on the "is-numeric" rules, and is there a hope for a "strictly numeric" test function ?
Thanks for clarifying it
I encounter a problem with the use of "is-numeric".
I naively thought that only numerals would be considered as numeric. I had the bad surprise to discover that it was far larger than that, and not easy to understand.
By example, an issue, entered as "14 - Du Dialogue", becomes "n° 14". The non-numeric part is lost.
For edition, volume, issue, it is very common to use mixed fields.
I would need a test on "strictly numeric".
If the field is "strictly numeric", we want to add a fixed prefix or suffix, if not strictly numeric, we want to take it as it is.
Is there any information on the "is-numeric" rules, and is there a hope for a "strictly numeric" test function ?
Thanks for clarifying it
Thanks for your help
I hoped to use this method to allow entering "à paraître" (to be published) in the date field.
I wrote:
<if variable="issued">
<choose>
<if is-numeric="issued">
<date variable="issued">
<date-part name="month" suffix=" " text-case="lowercase"/>
<date-part name="year"/>
</date>
</if>
<else>
<text variable="issued">
</else>
</choose>
but the validator refused it.
Error: Bad value issued for attribute variable on element text from namespace http://purl.org/net/xbiblio/csl.
Is there any method to retrieve non numeric data from the date field ?
If there was any, I would also use it for entering date-ranges (putting quotation-marks)
Thanks for your assistance
CSL 1.0 will be able to handle date ranges natively, so if you can wait until then, this will be covered, without any need for special treatment. CSL 1.0 will also support a "status" variable, so that (if Zotero supports it) to-be-published works can be flagged as such, and formatted accordingly.
Neither of these features is in Zotero 2.0. If you are able to find solutions, please remember that thngs will be different (and better) when Zotero 2.1 arrives.
I agree with not using non standard ways, but, since it is impossible to imagine all the potential situations, I think any system should provide a standard way to manage non-standard operations.
SIncerely
I still don't know how to manage with mixed fields that contain at least one number.
For example "tome XII-2" is considered as numeric, while "tome XII" is not.
Even if I put it between english quotes, the result is the same.
Any solution to distinguish numeric and mixed would be welcomed
Thanks
For the moment, if it is a mixed field as in the example above
tome XII-2
whatever it has been placed between english quotes or not, it is displayed:
vol. tome XXII-2
instead of:
tome XXII-2
That's what I wrote:
<macro name="volume">
<choose>
<if is-numeric="volume">
<text term="volume" form="short" suffix=". "/>
<text variable="volume"/>
</if>
<else>
<text variable="volume"/>
</else>
</choose>
</macro>
Your code is fine, and quoted escaping should work here; it was failing because of a bug in the detection of the quote marks.
I've applied a fix, but unfortunately didn't make it in time for the Zotero 2.1.7 release. If you need this in the short term, you'll need to use the branch XPI (after the processor revision, 1.0.177, makes it into the Zotero 2.1 branch).
Anyway, I am happy 2.1.7 is now available