[wpkg-users] Q: Failing to parse xml "Error parsing xml 'snip': The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document."

Adam Thorn alt36 at cam.ac.uk
Thu Jan 6 17:58:58 CET 2022

In addition to suggested fixes from others ....

The <package> element does not support the "date" attribute. I don't 
believe this will cause a problem for wpkg.js but would lead to 
validation errors if you were to use a tool to validate your XML against 
the relevant schema definition (which I strongly recommend you do 
habitually because it will help you catch and fix XML errors)

XSDs are not always very human-readable but the list of attributes 
expected for the <package> element is described at



On 06/01/2022 00:41, John N. wrote:
> I'm trying to debug a WPKG package.  The package xml passes my parser 
> check, but when run, WPKG reports an error:
> "Error parsing xml 'snip': The stylesheet does not contain a document 
> element.  The stylesheet may be empty, or it may not be a well-formed 
> XML document."
> One of our web coders suggests it may be a problem with the upstream 
> schema located at "http://www.wpkg.org/packages /xsd/packages.xsd" ?
> I'd appreciate any pointers if anyone can point out what I am missing...
> <?xml version="1.0" encoding="UTF-8"?>
> <packages:packages
>          xmlns:packages="http://www.wpkg.org/packages" 
> xmlns:wpkg="http://www.wpkg.org/wpkg" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xsi:schemaLocation="http://www.wpkg.org/packages 
> /xsd/packages.xsd" >
> <!-- RICOH printers -->
> <!--Unlike other packages, the RICOH primters need to be repackaged into 
> an installer before they can be provisioned. -->
> <!--This is a substantial process, and can be found here: 
> https://wiki.biostat.washington.edu/index.php/Ricoh_Printer_WPKG_Install 
> -->
> <!--Once the installers have been built, this file can be updated to 
> pull the new drivers. -->
> <!--msi-name is the name of the installer file for this printer -->
> <!--Use ORCA to get the guid of the installer.  It is found under 
> "Property" and "ProductCode".  This value will change with every 
> installer build, so don't forget to update it or the package will fail 
> to uninstall and upgrade.-->
> <!--Remember to up the revision by +1 when updating-->
>      <package
>      id="hrc3s-bw"
>      name="HRC 3rd floor Printer South: Black and White"
>      revision="5"
>      execute="once"
>      priority="5"
>      date="Jan 5 2022">
>          <variable name="printer" value="hrc3s-bw" />
>          <variable name="msi-name" 
> value="hrc3s-bw-TCP_IP-RICOH_PS_UniversalDriver_V4.32-64Bit-for64bitOS-1.0.0.msi" 
> />
>          <variable name="guid" 
> value="{75DEA569-99A4-4A5A-9815-0786F1F67D1C}" />
>          <install cmd='msiexec /i 
> "%root%\Drivers\Printers\ricoh\RePackage\%msi-name%" /norestart /qn' >
>          <install cmd='waitfor nothing /t 10' >
>          <exit code="0" />
>          </install>
>          <upgrade include="remove" />
>          <upgrade include="install" />
>          <remove 'msiexec /x %guid% /qn /norestart' />
>      </package>
> </packages:packages>

More information about the wpkg-users mailing list