cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Default ID inserted for Figure does not match the S1000D Spec

Default ID inserted for Figure does not match the S1000D Spec

When a figure is inserted with reuse the default graphic id is:

<figure id="F0001">

Whereas chapter 3.9.5.2.1.2 page 22 para 3 gives a recommended set of references as a Business Rule Decision which must be made for the format of the id. The present example, which is automatically inserted, does not follow the recommendation in the spec for the format of cross reference attribute id. It should appear as follows:

<figure id="fig-0001">

4 Comments
GregoryMackenzi
1-Newbie

In terms of usability, since this is automatically inserted and incremented, it would be handy to have acces to the location where this is defined, so that the user could modify it to their BR requirement if they are not following the recommendation in the spec, (I am on issue 4.)

It also brings up the idea of automatically numbering other elements with ids as they are inserted by the user.

DomenicLaritz
16-Pearl

Gregory, you should vote up your own idea!

And because you forgot it, that one too:

When creating a new product idea, it automatically adds a positive vote for the creator.

GregoryMackenzi
1-Newbie

In the meantime... Here's an Omnimark script which will put the recommended ids in a data module. It will increment the id number each time it finds a match. It is useful as then the elements are numbered in sequence and can easily be used for internalRef

Typical script results are:

levelledPara id="par-0001"

figure id="fig-0001"

table frame="all" id="tab-0001"

proceduralStep id="stp-0001"

You have to have Omnimark, although you could probably code something similar in other software. for Omnimark. ACL possibly, which I have not learned to use yet.

I copy the content of the data module into an input.txt file. The script puts the content of the modified input file into an output file. I turn off context rules, delete the original content of my source xml data module, paste in the content of the output file, and validate.

;The script

;omnimark -sb om_S1000D_Add_ID_Numbers.om input.txt -of output.txt -log error.txt

;GENERAL PURPOSE

;The purpose of this script is to create specific sequentially numbered id tags to the processed text.

;Script Author Gregory B. MacKenzie 2014-01-09

cross-translate

;this is a text to text translation

global counter ParaCountID initial {0001}

global counter StepCountID initial {0001}

global counter FigureCountID initial {0001}

global counter TableCountID initial {0001}

;**************************************************************************************************

;levelledPara

;**************************************************************************************************

find "<levelledPara>" => ParaTag

output "<levelledPara id=%"par-%4fzd(ParaCountID)%">"

; note that 4fz makes the number pad to the left with the four digits or whatever so that the number shows up correctly in the output. 0001 through 9999

increment ParaCountID

;**************************************************************************************************

;proceduralStep

;**************************************************************************************************

find "<proceduralStep>" => StepTag

output "<proceduralStep id=%"par-%4fzd(StepCountID)%">"

; note that 4fz makes the number pad to the left with the four digits or whatever so that the number shows up correctly in the output. 0001 through 9999

increment StepCountID

;**************************************************************************************************

;figure

;**************************************************************************************************

find ("<figure>" | ("<figure id=%"" letter digit+ "%">")) => FigureTag

output "<figure id=%"fig-%4fzd(FigureCountID)%">"

; note that 4fz makes the number pad to the left with the four digits or whatever so that the number shows up correctly in the output. 0001 through 9999

increment FigureCountID

;**************************************************************************************************

;table

;**************************************************************************************************

find "<table>" => TableTag

output "<table id=%"tab-%4fzd(TableCountID)%" "

; note that 4fz makes the number pad to the left with the four digits or whatever so that the number shows up correctly in the output. 0001 through 9999

increment TableCountID

;**************************************************************************************************

find "<table frame=%"all%">" => TableTag

output "<table id=%"tab-%4fzd(TableCountID)%" frame=%"all%">"

; note that 4fz makes the number pad to the left with the four digits or whatever so that the number shows up correctly in the output. 0001 through 9999

increment TableCountID

olivierlp
Community Manager
Status changed to: Archived

Hello,

We are archiving your idea as part of a general review. This action is based on the age of your idea and the total number of votes received, as per this announcement.

You can always post a new idea with all the details required in the form.

Thank you for your participation.