Extract metadata from DB5 document #736
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
When Docserv needs to extract metadata, it would have to deal with different sources: DocBook 5, assemblies, or ASCIIDoc. To ease parsing of all these different formats, a common interface would be helpful.
For example, daps could implement a
daps meta
ordaps metadata
which calls a XSLT stylesheet to extract all of that.Implementation
The PR contains this stylesheet that is called by the
daps meta
ordaps metadata
command.Conceptually, the stylesheet should only be applied to a full profiled XML file. Perhaps the
daps bigfile
could be used for that (or its internal target).meta[@name = 'productname']
and productname/productnumberinfo/title
or on the parenttitle
info/subtitle
or on the parentsubtitle
meta[@name='title']
meta[@name='description']
meta[@name='social-descr']
revhistory/revision[1]/date
meta[@name='task']
meta[@name='series']
meta[@name='category']
meta[@name='type']
By default, it outputs warnings if a meta data couldn't be found. The warnings go to stderr. For debugging purpuoses it might be helpful, but can give false positives. The warnings can be suppressed by passing the parameter
with-warn=0
to your XSLT processor.Example output from
DC-SLES-modules
using the bigfile fromdaps bigfile
: