Page 1 of 1

critdates not validating in Oxygen

Posted: Thu Mar 28, 2019 1:50 am
by kirkilj
I have a test map to explore metadata options for a map and I have a couple questions:

(1) Why would critdates be flagged as invalid in Oxygen when the error message indicates it should be fine in the topicmeta model:

<navtitle>?, <linktext>?, <searchtitle>?, <shortdesc>?, <author>*, <source>?, <publisher>?, <copyright>*, <critdates>?, <permissions>?, <metadata>*, <audience>*, <category>*, <keywords>, <exportanchors> <exportanchors>*, <prodinfo>*, <othermeta>*, <resourceid>*, <ux-window>*, (<data> | <sort-as> | <data-about> | <foreign> | <unknown>)*
...
<map>
<title>MetaData Test</title>
<topicmeta>
<copyright>
<critdates>
<created date="Big Bang"/>
<revised modified="The Now"/>
</critdates>
</topicmeta>
...
</map>

(2) The date attribute values in the created and revised elements appear to allow any text string with no validation of any format. I saw conflicting references in the docs that said that YYYY was the format in <copyryear>, but more specific in the above date attributes, MM-DD-YYYY or something similar. These don't appear to be validated as dates, obviously.

Re: critdates not validating in Oxygen

Posted: Thu Mar 28, 2019 8:38 am
by Radu
Hi John,

So:
1) Why would critdates be flagged as invalid in Oxygen when the error message indicates it should be fine in the topicmeta model:
Because you added the "critdates" inside the "copyright" instead of adding the element directly in the "topicmeta".

(2) The date attribute values in the created and revised elements appear to allow any text string with no validation of any format. I saw conflicting references in the docs that said that YYYY was the format in <copyryear>, but more specific in the above date attributes, MM-DD-YYYY or something similar. These don't appear to be validated as dates, obviously.[/quote]

We do not control the DITA specification but you can add your own custom Schematron checks.
For example our DITA prolog updater add-on has a setting which can be used to control in what format the date should be generated:

https://github.com/oxygenxml/oxygen-dita-prolog-updater

Regards,
Radu

Re: critdates not validating in Oxygen

Posted: Thu Mar 28, 2019 7:22 pm
by kirkilj
Sorry. That was a copy-paste accident. Here's the source in which critdates was marked invalid:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map>
<title>MetaData Test</title>
<topicmeta>
<copyright>
<copyryear year="April Fools Day"/>
<copyrholder>Nokia</copyrholder>
</copyright>
<prodinfo>
<prodname>Bass-o-matic</prodname>
<prognum>PN3423345G</prognum>
</prodinfo>
[color=#FF0000] <critdates>
<created date="Big Bang"/>
<revised modified="The Now"/>
</critdates>[/color]
<othermeta name="hairColor" content="brown"/>
</topicmeta>
<topicref href="../Documents/gitworks/dt-ditatestdocs/oxygen_guide/tasks/untitled1.dita"/>
</map>
BTW, how are spaces preserved in this Forum's version of BBCode? I tried a few different methods that I researched, including code and codebox, but they either made no difference in the post's formatting or the BBCode tags were rendered as if they were just part of the post's text instead of as a directive.

Re: critdates not validating in Oxygen

Posted: Fri Mar 29, 2019 10:15 am
by Radu
Hi John,

I edited your post and used "code" blocks for your XML content, it does not preserve those color highlights you added but I can live with it. I'm not sure how the PHPBB forum allows adding colors inside code blocks, probably it does not. I will add an internal issue to figure this out.
About your question, originally you pasted the entire content model of the "topicmeta" element. What can be seen in it is that the <prodinfo> must be added after the <critdates>:

Code: Select all

  <topicmeta>
<author type="contributor">radu_coravu</author>
<copyright>
<copyryear year="April Fools Day"/>
<copyrholder>Nokia</copyrholder>
</copyright>
<critdates>
<created date="Big Bang"/>
<revised modified="The Now"/>
</critdates>
<prodinfo>
<prodname>Bass-o-matic</prodname>
<prognum>PN3423345G</prognum>
</prodinfo>
Regards,
Radu

Re: critdates not validating in Oxygen

Posted: Fri Mar 29, 2019 7:29 pm
by kirkilj
Thanks Radu, I should've picked up on the sequencing requirement in the model representation.