I am wanting to use the bookpartno field from my ditamap on the cover of my manual. Currently I have two being used. How do I write the new one so it will choose the one in the middle?
/RDStyle/ResolvedMap/servicemanualmap/*[name()='bookmeta' or name()='servicemanualmeta']/bookid/bookpartno[last()]
Bryon
Thanks for the response Clay. We are using the first one for the book part no, the second one will be used for the dollar value of the manual and the third will be used for the publication year. From your example I would expect that as long we have defined a first and last, the numbering would be sequencal after that.
/RDStyle/ResolvedMap/servicemanualmap/*[name()='bookmeta' or name()='servicemanualmeta']/bookid/bookpartno[2]
/RDStyle/ResolvedMap/servicemanualmap/*[name()='bookmeta' or name()='servicemanualmeta']/bookid/bookpartno[3]
I see your point if one is left blank then the next one steps up and is the next number. I guess we would need to add a space so something would be there.
Thanks
Bryon
Hi Bryon—
Ah, OK. In that case, you should be able to use simple position predicates, as long as you always have the right number of bookpartno elements, including empty ones if no value is specified.
OTOH, as you describe the intended uses for these extra bookpartno elements, I wonder if maybe there would be other bookmeta markup elements better suited to those items. For example, publication year might be better stored as bookmeta/publisherinformation/published/completed (or, if it’s really a proxy for copyright date, as bookmeta/bookrights/copyyrlast).
Or, of course, for items that aren’t defined explicitly in standard DITA book metadata, you could use othermeta to avoid any ambiguity, something like this:
<bookmeta>
….
<othermeta name="”bookprice”" content="”$40.00”/">
<othermeta name="”publicationdate”" content="”2015”/">
</bookmeta>
I understand the occasional need to shoehorn some unusual data into a structure that wasn’t originally designed for it, but in this case, since DITA comes OOTB with a generic metadata mechanism, why not use it instead of overloading <bookpartno>?
--Clay
Thanks Clay, I am very green at this, so I looked at what was exsisting and try to replicate it for my new purpose. I did not think or know about the suggetions you made. I will see what I can figure out.
thank you
Bryon