Cannot solve the following Exception:The primary document entity could not be opened.

Posted on 2003-03-12
Medium Priority
Last Modified: 2007-12-19
When parsing a xml file with xsl file which includes a common.xsl using C++ xalan, such error occurs occationally(not always) :
An exception occurred! Type:RuntimeException, Message:The primary document entity could not be opened. Id=file:///home/common.xsl

How can i fixed so that i can prevent such error again ??
Thanks a lot.

THe following is the format of the xml and the xsls.
<?xml version="1.0" encoding="ISO8859-1"?>
  <Name>book mark</Name>
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" encoding="ISO8859-1"/>
<xsl:include href="common.xsl"/>
  <xsl:template match="/">
     <xsl:variable name="Name" select="Book/Name"/>    
     <xsl:call-template name="left-space-format">
         <xsl:with-param name="string1" select="$Name"/>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="left-space-format">
<xsl:param name="string1"/>

Question by:bigmouth1979
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 27

Accepted Solution

BigRat earned 1000 total points
ID: 8126968
Quite clearly it cannot open the include file. I personally don't like the URL file:///home/common.xsl

Although I presume that /home/common.xsl exists and is in good spirits, I suspect that the URL resolver is trying to handle the implied "localhost" part, possibly connecting to the local filestore remotely????? (I've done this on Windows, not however with Xalan, but with //computername/c/dir/file.txt - it didn't optimize the /// part out!)

If there is nothing against it, I'd make the reference in the XSL explicit :- file:/home/common.xsl


Featured Post

TCP/IP Network Protocol Cheat Sheet

TCP/IP is a set of network protocols which is best known for connecting the machines that make up the Internet. The truth is that TCP/IP is one of the oldest network protocols and its survival is mainly based on its simplicity and universality.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question