Thank you for the reply Micheal.
I have changed my XSLT and the document() call.  It now contains the following update:
<xsl:variable name ="_intfModelName" select ="substring-before(@Text,':/')"/>
<xsl:variable name ="_intfFileName" select ="concat('../../OtherXMLFiles/',$_intfModelName,'.xml')"/>
<xsl:apply-templates select ="document($_intfFileName, /)/*[@Name=$_intfModelName]/*">
Unfortunately, the results are the same – no data.  By the way, there are no blanks.
In my Internet searches (and I cannot recall the source) I might have read that the saxon XSLT processor does not handle UNC paths that contain spaces well?  If that is so, then there is a problem with that.  Also, the location of our saxon.HE executable & dll files are located on a dedicated server which our app references and our data resides on another server(s) and/or personal computers.  Regardless, the directory structure will always be the same, in regards to relative paths (based on the initial source XML File).
I’m at a loss at this point… any assistance is appreciated.
Thank you.
- Lawrence D Tsosie
From: Michael Kay (
Subject: Re: [saxon] App using saxonHE ( api to process XSLT (v2.0) against multiple XML files
The problem is that you are calling document() to resolve a relative URI
whose base URI is unknown. Because you use substring-before to compute
the relative URI, the argument is a string, so the base URI it will use
is that of the stylesheet. The stylesheet's base URI is unknown because
you built the stylesheet from a stream; in this situation Saxon defaults
to the current working directory. You can set the base URI using the
XsltCompiler.BaseUri property.
Alternatively, if you want the relative URI resolved relative to the XML
source document, use "/" as the second argument of the call to document().
I'm a little surprised that it's producing blank output rather than an
error. Perhaps Saxon isn't catching all the relevant exceptions.
Michael Kay
On 12/04/2012 22:20, LAWRENCE D TSOSIE wrote:
I have an application that uses the SAXONHE api files to transform XML
data to plain text. My form has textboxes for
1) XMLInput_FilePath
2) XSLT_FilePath
3) TextOutput_FilePath
On the okButton_Click() event of my form, I have the following:
private void okButton_Click(object sender, EventArgs e) {
      FileStream xsltTransform_FileStream = File.Open
(xsltTransform_FilePath.Text, FileMode.Open, FileAccess.Read,
      FileStream xmlInput_FileStream = File.Open(xmlInput_FilePath.Text,
FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
       XmlTextReader modelFileXML = new XmlTextReader(xmlInput_FileStream);
modelFileXML.XmlResolver = null;
       Processor processor = new Processor();
       XdmNode input = processor.NewDocumentBuilder().Build(modelFileXML);
       XsltTransformer xsltTransformer = processor.NewXsltCompiler().Compile
       xsltTransformer.InputXmlResolver = null;
       xsltTransformer.InitialContextNode = input;
       Serializer serializer = new Serializer();
Within the context of my XMLInput file there is a reference to data in another
XML file (save XMLInput2_File).
<Path Text="XMLInput2_File:/XMLInput2_File/Subsystem_1/Field_3" />
The Text attribute is where the external XML File path is stored, in the above
example, the XML filename would be "XMLInput2_File.xml".
Within my XSLT, I have the following:
<xsl:variable name ="_intfModelName" select ="substring-before(@Text,':/')"/>
<xsl:variable name ="_intfFileName" select ="concat
<xsl:apply-templates select ="document($_intfFileName)/*
Every time I use the C# Winforms application with the saxon api calls, my
resulting output is blank.  Using Microsoft's Visual Studio 2008 Professional
Edition to test the XSLT against the files - I get data.  Is there something
with my saxon api calls??  Any help is appreciated.  Thank you in advance.
- Lawrence D Tsosie
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
saxon-help mailing list archived at
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
saxon-help mailing list archived at