Data::Edit::Xml::Xref - Cross reference Dita XML.
Check the references in a set of Dita XML documents held in folder inputFolder:
use Data::Edit::Xml::Xref; my $x = xref(inputFolder=>q(in)); ok $x->statusLine =~ m(\AXref Errors: 56 bad xrefs, 8 bad conrefs, 2 bad topicrefs, 8 missing images, 8 duplicate ids, 11 bad first lines, 11 bad second lines\Z); Xref Errors: 1 file failed to parse, 48 bad xrefs, 8 bad conrefs, 2 bad topicrefs, 7 missing image refs, 1 image file found, 7 missing image files, 8 duplicate ids, 11 bad first lines, 11 bad second lines\Z);
More detailed reports are produced in the reports folder:
$x->reports
Cross reference Dita XML.
Version 20181030.
The following sections describe the methods in each functional area of this module. For an alphabetic listing of all methods by name see Index.
Check the cross references in a set of Dita files and report the results.
Check the cross references in a set of Dita files held in inputFolder and report the results in the reports folder. The possible atributes are defined in Data::Edit::Xml::Xref
Parameter Description 1 %attributes Attributes
Example:
my $x = 𝘅𝗿𝗲𝗳(inputFolder=>q(in), maximumNumberOfProcesses=>16);
Attributes used by cross referencer.
badConRefs - [file, href] Invalid conref attributes.
badImageRefs - [file, href] Missing images.
badTopicRefs - [file, href] Invalid href attributes topicref tags.
badXRefs - [file, href] Invalid href attributes on xref tags.
badXml1 - Files with a bad xml encoding header on the first line.
badXml2 - Files with a bad xml doc type on the second line.
conRefs - {file}{id}++ Conref definitions.
duplicateIds - [file, id] Duplicate id definitions within a file.
duplicateTopicIds - [topicId, [files]] Files with duplicate topic ids
ids - {file}{id}++ Id definitions across all files.
images - {file}{href}++ Images references.
imagesFound - Consolidated images found
imagesMissing - Consolidated images missing
inputFiles - Input files from inputFolder.
inputFolder - A folder containing the dita and ditamap files to be cross referenced.
maximumNumberOfProcesses - Maximum number of processes to run
parseFailed - [file] files that failed to parse
reports - Reports folder: the cross referencer will write reports to files in this folder.
results - Results table
statusLine - Status line summarizing the cross reference.
summary - Print the summary line.
topicIds - {file} = topic id
topicRefs - {file}{href}++ Topic references.
xRefs - {file}{href}++ Xrefs references.
Load the names of the files to be processed
Parameter Description 1 $xref Cross referencer
Analyze one input file
Parameter Description 1 $iFile File to analyze
Analyze the input files
Report duplicate ids
Report bad references found in xrefs or conrefs as they have the same structure
Parameter Description 1 $xref Cross referencer 2 $type Type of reference to be processed
Report bad xrefs
Report bad topic refs
Report bad conrefs refs
Reports on images and references to images
Report failed parses
Report bad xml on line 1
Report bad xml on line 2
Create sample input files for testing. The attribute inputFolder supplies the name of the folder in which to create the sample files.
Parameter Description 1 $N Number of sample files
1 analyze - Analyze the input files
2 analyzeOneFile - Analyze one input file
3 createSampleInputFiles - Create sample input files for testing.
4 loadInputFiles - Load the names of the files to be processed
5 reportBadConrefs - Report bad conrefs refs
6 reportBadRefs - Report bad references found in xrefs or conrefs as they have the same structure
7 reportBadTopicRefs - Report bad topic refs
8 reportBadXml1 - Report bad xml on line 1
9 reportBadXml2 - Report bad xml on line 2
10 reportBadXrefs - Report bad xrefs
11 reportDuplicateIds - Report duplicate ids
12 reportImages - Reports on images and references to images
13 reportParseFailed - Report failed parses
14 xref - Check the cross references in a set of Dita files held in inputFolder and report the results in the reports folder.
This module is written in 100% Pure Perl and, thus, it is easy to read, comprehend, use, modify and install via cpan:
sudo cpan install Data::Edit::Xml::Xref
philiprbrenan@gmail.com
http://www.appaapps.com
Copyright (c) 2016-2018 Philip R Brenan.
This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
To install Data::Edit::Xml::Xref, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Edit::Xml::Xref
CPAN shell
perl -MCPAN -e shell install Data::Edit::Xml::Xref
For more information on module installation, please visit the detailed CPAN module installation guide.