Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

xsl:result-document not working ?

Advocate ,
Dec 14, 2014 Dec 14, 2014

Copy link to clipboard

Copied

Hello all,

I am developing a structured app in which I need to split my FM file into a number of separate XML output files. Using xsl:result-document works fine outside of FM, but when using the same XSL from inside FM there are no result documents. I tried to run this on a network drive and on a local drive, but that does not seem to make a difference. I did switch the default XSLT processor in the maker.ini file to use the Saxon XSL 2 processor, so that cannot be the problem. I am guessing it has something to do with the Windows privileges in creating new files but how can those be different for the program when it creates a new file and the same program running an XSLT processor that creates a new file.

If anyone has used xsl:result-document succesfully in the postprocessing of FM, let me know what the trick was.

Jang

TOPICS
Structured

Views

1.2K
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Dec 14, 2014 Dec 14, 2014

OK, I found the cause of the problem. xsl:result-document is in fact working but the crappy Windows convention of using backslash instead of forward slashes (and drive letters instead of volume names) used in the real computer world causes problems in setting the correct path. At least I know where to look for a solution now. Thanks anyway.

Votes

Translate
Advocate ,
Dec 14, 2014 Dec 14, 2014

Copy link to clipboard

Copied

OK, I found the cause of the problem. xsl:result-document is in fact working but the crappy Windows convention of using backslash instead of forward slashes (and drive letters instead of volume names) used in the real computer world causes problems in setting the correct path. At least I know where to look for a solution now. Thanks anyway.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 14, 2014 Dec 14, 2014

Copy link to clipboard

Copied

LATEST

Sorry for the Windows-bashing - but working on a Mac with Windows on a virtual machine means I am constantly running into compatibility problems. Everything works fine from <oXygen/> on the Mac and then does not work at all from FrameMaker on Windows. Instead of using any external or fixed references to files I have now found the way to reference the current XML file that is being processed. But then I need the directory name of that file, and this requires a little bit of XSL that I found on Stack Overflow. If others are running into similar problems, use this piece of code:

    <xsl:variable name="basepath">
        
<xsl:call-template name="getURL">
            
<xsl:with-param name="path" select="base-uri()"/>
        
</xsl:call-template>
    
</xsl:variable>
    
    
<xsl:template name="getURL">
        
<xsl:param name="path"/>
            
<xsl:choose>
                
<xsl:when test="contains($path,'/')">
                    
<xsl:value-of select="substring-before($path,'/')"/>
                    
<xsl:text>/</xsl:text>
                    
<xsl:call-template name="getURL">
                        
<xsl:with-param name="path" select="substring-after($path,'/')"/>
                    
</xsl:call-template>
                
</xsl:when>
                
<xsl:otherwise/>
            
</xsl:choose>
    
</xsl:template>


After this, your $basepath will point to the directory of the XML file that is being processed by the XSL. No more dependence on drive letters and forward or backward slashes.

Ciao

Jang

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines