cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Print Compose multiple XML files into one PDF?

Highlighted
it1
Newbie

Print Compose multiple XML files into one PDF?

Fellow Forum Members,

Is it possible in Arbortext Editor 6.1 to use the Print Compose feature for the task of printing 150 separate XML files into a single PDF in a batch mode process? The idea I have is to code a XML file that will list all of the XML files in the order I want and here is where I need help. How can I direct the Print Compose tool to print all of the XML files in a batch mode by using such a XML list file?  Any opinion on how I can accomplish this will be greatly appreciated.  Thanks in advance.

10 REPLIES 10

Re: Print Compose multiple XML files into one PDF?

Hi Ivan,

This sounds like the sort of thing which is typically handled by creating a top-level XML file which references the 150 other files via XML Include or file references. This requires that the top-level tag in your included files is allowed (in context) within some tag in your including document. This may require a small amount of DTD/XML Schema work. Or the 150 files could be saved as fragments with their top-level tag removed. One way to create such fragments is to select everything except the top-level tag and Select Entities > Create File Entity from Selection.

Is this along the right lines, or did I misunderstand your situation?

Best regards,

Gary Grosso

Oberon Technologies Inc

Re: Print Compose multiple XML files into one PDF?

If this is something that you need to do regularly, I suggest Gary's first approach of modifying your Schema/DTD to support a top-level XML file (map?) that references the XML that you need to publish. Then you can use File References (xincludes) to reference the other XML files.

-Jeff

Re: Print Compose multiple XML files into one PDF?

Gary and Jeff,

Thanks for the two great postings.  I have continued researching this problem and have narrowed it down to what is known as a "WRAPPER FILE". Which is pretty much what both of you are describing in your postings.  A wrapper file is hard coded in XML and inside of it one needs to code all 150 xml files in a list as references that reflects the order you want your 150 XML files to output in as a PDF.  Gary I think I follow with what you mention about selecting all tags (except to level tag) and then selecting the  "Create File Entity from Selection" menu item in Arbortext. However, I hope you can clarify whether or not if it is still necessary for me to tweak the S1000D 4.01 Schema I'm using  if I change all 150 of my XML files over to becoming Entities?  It would be cool if I can avoid tweaking the Schema. Also once I have 150 entities created how do I wrap them so that Arbortext Print Compose sees all of the 150 entities as a single consolidated XML file that needs to be converted into a single PDF in a single print operation? 

If anyone out there can please expand on how to code a WRAPPER file by posting some actual XML coding examples it will be much appreciated. Also examples on how to get it to work by relying in using Entities will be much appreciated.  In short, any help will be tremendously appreciated because I need help.  Thanks in advance.

Re: Print Compose multiple XML files into one PDF?

Hi Ivan,

Here is an example. Open Arbortext Editor, do File > New, select the DocBook sample.

Image18.jpg

Position after <book>, and do Edit > Select Element Content.

To see Entities > Create File Entity from Selection, you need to enable Tools > Preferences > Window > Full menus.

Now, for some reason, in this case, I had trouble with Create File Entity from Selection. You may have to ask PTC support about that.

So I did a cut (control-X) of the content of the book element, and from the command line, did:

write -paste C:\temp\fragtest\docguts.xml

Then I did Insert > File Reference, and browsed to C:\temp\fragtest\docguts.xml. Voila.

Notice that the fragment starts with title. If you look at the innards of docguts.xml, it starts out like:

<?xml version="1.0" encoding="UTF-8"?>

<!-- Fragment document type declaration subset:

Arbortext, Inc., 1988-2015, v.4002

<!DOCTYPE set PUBLIC "-//Arbortext//DTD DocBook XML V4.0//EN"

"axdocbook.dtd">

-->

<title>PTC Employs Its Own Arbortext&reg; Software to Improve Delivery

It isn't really valid per any DTD/Schema; the DOCTYPE declaration is in a comment. So it's when you try to include it into your top-level document (into the DocBook book element, in this example) that it's content gets context checked for insertion into <book>.

Of course, you'll need to create 150 such fragment files, and do 150 Insert > File Reference operations into your top-level includer document. It would be possible to write ACL to help automate this, but I fear that would be beyond the scope of this forum. Perhaps others know of an easy or out of the box way to simplify the process for you.

Best regards,

Gary Grosso

Oberon Technologies Inc

Re: Print Compose multiple XML files into one PDF?

Hi Ivan T,

S1000D supports a type of content called Publication Modules. These allow you to aggregate your DMs (Data Modules) into a final publication. Isn't this what you are trying to achieve?

Regards,

Gareth

Re: Print Compose multiple XML files into one PDF?

Gareth,

Thank you very much for your post.  You are correct in pointing out S1000D supports a type of data module called a " Publication Data Module" which is what I am in turn referring to as a "WRAPPER FILE".  And yes what I am trying to do is aggregate all of my data modules into a single XML file which I can then feed to the Print Composer option in my Arbortext Editor.  The big problem is the Print Compose feature in Arbortext Editor seems to totally reject the "Publication Module.xml " file I have coded. It seems to be blind to the entire wrapper file and only outputs a single page which is the front cover as a PDF file.

Does anyone out there know what code I need to add to my Publication Module.xml " file so that the Print Compose feature in my Arbortext Editor accepts it and processes all of the XML files into a single PDF using the Army provided XSLT stylesheet I define. 

Below is some sample code from an actual S1000D Publication Data Module. It's from an example manual that is public information. Please note, it only contains references to three XML files identified by the opening tag "<dmRef id="dm-000">".  I would like to know what code I need to add to the code below so that Arbortext Editor Print Composer does not reject it and outputs a PDF of all dmrefs listed in the code. Any help will be greatly appreciated.

<?xml version="1.0" encoding="UTF-8"?>

<?xml-stylesheet type="text/xsl" href="pm4-0.xsl"?>

<?altova_xslfo FO-3031-A00-USARMY-MAIN_001-00_EN-US.xsl?>

<pm xmlns:dc="http://www.purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.s1000d.org/S1000D_4-0/xml_schema_flat/pm.xsd">

  <rdfSmiley Very Happyescription>

  <dc:title>Phun Gun Operator and Field Maintenance Manual</dc:title>

  <dc:creator>07GB6</dc:creator>

  <dc:subject>Phun Gun</dc:subject>

  <dc:identifier>TM 9-1005-666-13</dc:identifier>

  <dc:language>en-US</dc:language>

  </rdfSmiley Very Happyescription>

  <identAndStatusSection>

  <pmAddress>

  <pmIdent>

  <pmCode modelIdentCode="S1000DGUN" pmIssuer="91005" pmNumber="MM301" pmVolume="00"/>

  <language countryIsoCode="US" languageIsoCode="en"/>

  <issueInfo inWork="00" issueNumber="001"/>

  </pmIdent>

  <pmAddressItems>

  <issueDate day="15" month="09" year="2011"/>

  <pmTitle>Operator &amp; Field Maintenance Manual</pmTitle>

  <shortPmTitle>Phun Gun 30D (NSN 4940-00-017-0000) (EIC OOH)</shortPmTitle>

  </pmAddressItems>

  </pmAddress>

  <pmStatus issueType="new">

  <security securityClassification="01"/>

  <dataRestrictions>

  <restrictionInstructions>

  <dataDistribution>DISTRIBUTION STATEMENT A:  Approved for public release; distribution is unlimited.</dataDistribution>

  <exportControl>

  <exportRegistrationStmt>

  <simplePara>WARNING: Export control statement here.</simplePara>

  </exportRegistrationStmt>

  </exportControl>

  <dataDestruction>DESTRUCTION NOTICE: Destroy by any means possible to prevent disclosure of contents or reconstruction of the document.</dataDestruction>

  </restrictionInstructions>

  <restrictionInfo>

  <policyStatement>Classification source and reason for classification of this publication per DODI 5200.001-R.</policyStatement>

  </restrictionInfo>

  </dataRestrictions>

  <responsiblePartnerCompany>

  <enterpriseName>HEADQUARTERS, DEPARTMENT OF THE ARMY</enterpriseName>

  </responsiblePartnerCompany>

  <originator enterpriseCode="1L6T4">

  <enterpriseName>US Army Materiel Command (AMC) Logistics Support Activity (LOGSA)</enterpriseName>

  </originator>

  <applic>

  <displayText/>

  </applic>

  <pubMedia pubMediaCode="PDF" pubMediaType="PDF - Optimized for Standard page size"/>

  <qualityAssurance>

  <firstVerification verificationType="tabtop"/>

  </qualityAssurance>

  <remarks>

  <simplePara>General purpose notices may appear here.</simplePara>

  </remarks>

  </pmStatus>

  </identAndStatusSection>

  <content>

  <pmEntry pmEntryType="pmt51">

  <dmRef id="dm-0001">

  <dmRefIdent>

  <dmCode modelIdentCode="S1000DGUN" systemDiffCode="0" systemCode="00" subSystemCode="0" subSubSystemCode="0" assyCode="00" disassyCode="00" disassyCodeVariant="A" infoCode="012" infoCodeVariant="J" itemLocationCode="A"/>

  <issueInfo inWork="00" issueNumber="001"/>

  </dmRefIdent>

  <dmRefAddressItems>

  <dmTitle>

  <techName>Phun Gun</techName>

  <infoName>Safety summary</infoName>

  </dmTitle>

  </dmRefAddressItems>

  </dmRef>

  <dmRef id="dm-0002">

  <dmRefIdent>

  <dmCode modelIdentCode="S1000DGUN" systemDiffCode="0" systemCode="00" subSystemCode="0" subSubSystemCode="0" assyCode="00" disassyCode="00" disassyCodeVariant="A" infoCode="00S" infoCodeVariant="A" itemLocationCode="A"/>

  <issueInfo inWork="00" issueNumber="001"/>

  </dmRefIdent>

  <dmRefAddressItems>

  <dmTitle>

  <techName>Phun Gun</techName>

  <infoName>List of effective data modules</infoName>

  </dmTitle>

  </dmRefAddressItems>

  </dmRef>

  <dmRef id="dm-0003">

  <dmRefIdent>

  <dmCode modelIdentCode="S1000DGUN" systemDiffCode="0" systemCode="00" subSystemCode="0" subSubSystemCode="0" assyCode="00" disassyCode="00" disassyCodeVariant="A" infoCode="001" infoCodeVariant="A" itemLocationCode="A"/>

  <issueInfo inWork="00" issueNumber="001"/>

  </dmRefIdent>

  <dmRefAddressItems>

  <dmTitle>

  <techName>Phun Gun</techName>

  <infoName>Title page</infoName>

  </dmTitle>

  </dmRefAddressItems>

  </dmRef>

  </pmEntry>

  </content>

</pm>

Re: Print Compose multiple XML files into one PDF?

Are you using the PTC S1000D software? Or just some stylesheets you got from somebody? Hint: the PTC software will handle this for you.

If you want to write your own PM handler it is a relatively simple algorithm. You will need to connect to the CSDB, iterate through the PM and merge in all <dmRef> content from the CSDB. The output from that process will be a monolithic PM containing all data for publishing.

If you want to use built-in behaviours of Arbortext then instead you will need to have all your DMs available either on the filesystem or network (as http:// links). You can then use either XInclude or File Entities as the other responses in this thread have mentioned. The idea being to replace each <dmRef> with an entity include or XInclude.

Re: Print Compose multiple XML files into one PDF?

Gareth Oakes,

Thanks for your second post. From what Google tells me converting to an entity is not a good approach because entities pose several limitations. In contrast, XInclude does not. Therefore, I am opting to accomplish this wrapper file project utilizing the XInclude function. Just to clarify, I am using the PTC S1000D CSDB module and also the PTC Publisher module and Arbortext Editor. From the PTC Publisher module I have the ability to download the complete set of raw XML files and in addition I also get an auto generated Publication Module file that lists all of XML files as <DMrefs>. As for what you mention about merging and creating a monolithic PM file using the CSDB is something I don't fully understand since I do not see any CSDB menu option that will enable me to this.

Nevertheless, the XML code inside my auto generated Publication Module (PM) file included in the download looks similar to the example code I posted in my previous post. Just to confirm, are you saying if I change all of the tags in the PM file from <DMref> over to <XInclude>  I will have the majority of the work done and a file Arbortext Editor will not reject?  In addition, all of my Raw XML files currently reside in my C:\XMLdata  folder together with the PM file (no files are in the network). Again just to confirm, step one will be to open from within Arbortext Editor the new PM file containing new XInclude tags and then step two would be to setup the Print Composed dialog window with the settings shown below.

Print Composed.jpg

Then hit "OK" and I should get a single PDF with all XML files included.  Am I correct in what I think are the steps I need to follow? Or is there some additional XML code editing I need to do to the PM file to get it to work within Arbortext Editor Print Composed feature? Any opinion will be greatly welcomed.  Thanks.

Re: Print Compose multiple XML files into one PDF?


Gareth, or anyone else that may be able to help.  I'm having some difficulty integrating the <x:include> tag and dropping the <dmref> usage.  I got a problematic PDF output when I tried replacing the one for the other.  Can anyone out there please post some XML code example on how to code a hybrid PM file that replaces all <dmref> tags with  <x:include> tags that Arbortext Editor will have no problem processing.  Thanks in advance.