How can I specify the absolute path for an external xml while reading it through document function in XSLT ?

I have an xslt which is processing an xml file. Simultaneously I need to read content from another external xml. I am doing this using document function.

The problem is that the xslt processor searches for the external XML in the same location where my XSLT file resides. I want a means by which I can specify a different path from where it should search my external xml file.

I guess using document function there is a way to specify the absolute path but I dont know how to use it. Can anyone please help me quickly on this ?

this syntax usually works
make the file reference a file uri
so prepend with "file:///" and make all back slashes into forward slashes
so on windows
<xsl:value-of select="document('file:///c:/mydir/myfile.xml')//myelement"/>

On Unix you will need exactly the same approach, since the the path seperators allready are "/"
you just need to prepend with "file:///"

picking up something from a config file in XSLT actualy means you would use the document() function
leading to the same problem.
The best way you can deal with configuration in XSLT is by passing in a parameter
Just create an xsl:param at the top level of the stylesheet, so you can pass in a value.
How that happens depends on how you start the XSLT

Thanks for your response.
I am passing the file path to the XSLT through a parameter but the problem is when I try to use that the xslt translation fails with OutOfMemoryError : Java heap space.
If I give a hard coded path for the external XML in the document function arguement it works fine.
Please see attached XSLT for reference attached as RegReportingAll.txt.

In the attached xsl file the code snippet
<xsl:for-each select="document($AgreeReportPath)//Agreements[Agreement_Id=$AgreementIdToProcess]">
causes the OutOfMemoryError when I pass a variable in the document function.

Whereas if I use the hard coded path for an XML then it works
<xsl:for-each select="document('file:///C://Input_Feeds//AgreementsReport.xml')//Agreements[Agreement_Id=$AgreementIdToProcess]">

Please can you suggest how this can be fixed. I need to pass parameters to XSLT in order to pass the XML path to the XSLT since that will differ based on environments.

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

I need to object.
The correct and complete answer to the original question has been given
ID:24761099; Author:Gertone
so refund is not a good option

I admit I have been a bit relaxed on the follow up question.
The out of memory is caused by the quality of the stylesheet.
I will expand on that in the next comment, but bottom line is... that is a follow up that has nothing to do with the original question

This is very expensive in memory terms.
You make an in memory object from an external file, each time for the iteration inside the iteration
(that is a lot of calls to the document function)

Instead you should make one variable, which is this object
<xsl:variable name="my-lookup-doc" select="document($AgreeReportPath)"/>
on the global level

and use it like this
<xsl:for-each select="$my-lookup-doc//Agreements[Agreement_Id=$AgreementIdToProcess]">
This way you only have one extra document in memory

Also note that you need to estimate an extra memory use of about ten times the size of the lookup document
That might be a problem too

Two other comments with your stylesheet
- used apply-templates and seperate templates instead of nested for-each
it will help the readability and the performance of your stylesheet
- you might want to turn the procesing arround.
All you need from the source document seems to be the list of collection/Asset_Holdings_and_Valuation/Agreement_Id
It might be worthwhile to completely change the approach.
+ extract a simple XML file just containing a list of IDs
+ Use a groupuing mechanism using your lookup document as a source
+ sort the groups according to the information in the extracted files with IDs
This way you will solve a lot of the mem issues you had

Your memory problem was an EE question on its own.
Consider this an extra.
As said before: The original question was answered way before that problem popped up

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX.
The logical flow for the problem should be:
Write an event handler for the first drop down box to get …

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…

The viewer will receive an overview of the basics of CSS showing inline styles.
In the head tags set up your style tags:
(CODE)
Reference the nav tag and set your properties.: (CODE)
Set the reference for the UL element and styles for it to ensu…

The viewer will learn the basics of jQuery, including how to invoke it on a web page.
Reference your jQuery libraries: (CODE)
Include your new external js/jQuery file: (CODE)
Write your first lines of code to setup your site for jQuery.: (CODE)