1

I am using SAS PROC XSL to create a new XML by consolidating info from more than one XML. For this purpose am using Document() function with path to the XML file in the (). This code is working fine when I submit the code on Windows, but not on LINUX server. To my surprise there is no error or warning message in the log. I am using XSL processer 1.0.

content of xsl file used

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:template match="/">
<root>
    <xsl:comment>One Argument </xsl:comment>
    <xsl:for-each select="document('/project/dev/xml_test/b.xml')//a">
        <xsl:copy-of select="."/>
    </xsl:for-each>

    <xsl:comment>Two Argument </xsl:comment>
    <xsl:for-each select="document('/project/dev/xml_test/a.xml', .)//a">
        <xsl:copy-of select="."/>
    </xsl:for-each>
</root>
</xsl:template>
</xsl:stylesheet>

SAS code:

filename infile "/project/dev/xml_test/b.xml" ;

filename style "/project/dev/xml_test/xslfile.xsl"; --the content is as given above

filename outfile   "/project/dev/xml_test/c.xml";



proc xsl in=infile xsl=style out=outfile;
run;
2
  • 3
    Please include enough information, preferably code and data, to reproduce your problem. Also, do not use ALL CAPS in your title. (Fixed.) Thanks. Commented Dec 26, 2013 at 16:22
  • Here is the xml content and the xsl file used.. Commented Dec 26, 2013 at 17:03

1 Answer 1

6

Use a URI format for your specification of the filename argument to the document() function:

file:///path/to/document.xml

Or, for Windows if you require a drive designator:

file:///x:/path/to/document.xml

Note that there are three /s in a row. (Normally there'd be two /s followed by a host followed by another /, but for the local filesystem, the host is omitted.)

Sign up to request clarification or add additional context in comments.

1 Comment

Hi kjhughes, The solution you gave is working fine. Thanks for the help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.