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=>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);

         {push @bad, [qq(No topic id on topic in target file),
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=>folder and report the results.

     Parameter    Description
  1  %attributes  Attributes

Example:

    my $x = 𝘅𝗿𝗲𝗳(inputFolder=>q(in));                                             
  

Hash Definitions

Data::Edit::Xml::Xref Definition

Attributes used by a cross referencer

badConRefs - [file, href] Invalid conrefs

badImages - [file, href] Missing images

badTopicRefs - [file, href] Invalid topic refs

badXRefs - [file, href] Invalid xrefs

badXml1 - Files with a bad xml encoding header on line 1

badXml2 - Files with a bad xml doc type on line 2

conRefs - {file}{id}++ Conref definitions

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 from inputFolder.

inputFolder - A folder containing the dita and ditamap files to be cross referenced.

reports - Reports folder, use this to receive reports from the cross reference.

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

reportBadRefs($$)

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

reportBadXrefs($)

Report bad xrefs

     Parameter  Description
  1  $xref      Cross referencer

reportBadTopicRefs($)

Report bad topic refs

     Parameter  Description
  1  $xref      Cross referencer

reportBadConrefs($)

Report bad conrefs 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 analyze - Analyze the input files

2 createSampleInputFiles - Create sample input files for testing.

3 loadInputFiles - Load the names of the files to be processed

4 reportBadConrefs - Report bad conrefs refs

5 reportBadImages - Report bad images

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 xref - Check the cross references in a set of Dita files held in inputFolder=>folder and 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

philiprbrenan@gmail.com

http://www.appaapps.com

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.