Name
Data::Edit::Xml::Xref - Cross reference data held in the XML format.
Synopsis
Check the references in a set of XML documents held in a folder:
use Data::Edit::Xml::Xref;
my $x = xref(inputFolder=>"in");
ok $x->statusLine =~ m(\AXref Errors: 56 bad xrefs, 2 bad topicrefs, 8 missing images, 8 duplicate ids, 11 bad lines 1, 11 bad lines 2\Z);
More detailed reports are produced in the:
$x->reports
folder.
Description
Cross reference data held in the XML format.
The following sections describe the methods in each functional area of this module. For an alphabetic listing of all methods by name see Index.
Attributes
Create a cross referencer.
Cross reference
Check the cross references in a set of Dita files and report the results
xref(%)
Check the cross references in a set of Dita files held in inputFolder=>folderand report the results.
Parameter Description
1 %attributes Attributes
Example:
my $x = 𝘅𝗿𝗲𝗳(inputFolder=>"in");
Hash Definitions
Data::Edit::Xml::Xref Definition
Attributes used by a cross referencer
badImages - [file, href] Missing images
badTopicRefs - [file, href] Invalid topic refs
badXml1 - Files with a bad xml encoding header on line 1
badXml2 - Files with a bad xml doc type on line 2
badXrefs - [file, href] Invalid xrefs
duplicateIds - [file, id] Duplicate id definitions within a file
ids - {file}{id}++ Id definitions across all files
images - {file}{href}++ Images references
inputFiles - Input files
inputFolder - A folder containing the dita and ditamap files to be cross referenced.
reports - Reports folder
statusLine - Status line
summary - Print a summary line
topicIds - {file} = topic id
topicRefs - {file}{href}++ Topic refs
xrefs - {file}{href}++ Xrefs references
Private Methods
loadInputFiles($)
Load the names of the files to be processed
Parameter Description
1 $xref Cross referencer
analyze($)
Analyze the input files
Parameter Description
1 $xref Cross referencer
reportDuplicateIds($)
Report duplicate ids
Parameter Description
1 $xref Cross referencer
inputFile($$)
FFile relative to current directory
Parameter Description
1 $xref Cross referencer
2 $file Short file name
absInputFile($$)
Fully qualified file from file relative to input folder
Parameter Description
1 $xref Cross referencer
2 $file Short file name
reportBadXrefs($)
Report bad xrefs
Parameter Description
1 $xref Cross referencer
reportBadTopicRefs($)
Report bad topic refs
Parameter Description
1 $xref Cross referencer
reportBadImages($)
Report bad images
Parameter Description
1 $xref Cross referencer
reportBadXml1($)
Report bad xml on line 1
Parameter Description
1 $xref Cross referencer
reportBadXml2($)
Report bad xml on line 2
Parameter Description
1 $xref Cross referencer
createSampleInputFiles($)
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
Index
1 absInputFile - Fully qualified file from file relative to input folder
2 analyze - Analyze the input files
3 createSampleInputFiles - Create sample input files for testing.
4 inputFile - FFile relative to current directory
5 loadInputFiles - Load the names of the files to be processed
6 reportBadImages - Report bad images
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 xref - Check the cross references in a set of Dita files held in inputFolder=>folderand report the results.
Installation
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
Author
Copyright
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.