Project

Profile

Help

Bug #4280

Updated by Michael Kay over 5 years ago

There is an issue when calling: 

 ~~~ cpp 
 var transformer = _xsltCompiler.Compile(new Uri(stylesheetPath)).Load(); 
 ~~~ 

 These are the following lines I have that's dealing with the file system.  

  
 ~~~ xml 
  <xsl:function name="pn:find-image-filepath"> 
         <xsl:param name="filename"/> 

         <xsl:variable name="file-path" 
                       select="file:list(file:parent(file:base-dir()), true(), concat($filename, '*'))[1]"/> 

         <xsl:choose> 
             <xsl:when test="$file-path"> 
                 <xsl:value-of select="file:path-to-uri(concat(file:parent(file:base-dir()), $file-path)))"/> 
             </xsl:when> 
             <xsl:otherwise> 
                 <xsl:message terminate="no">Could not find image file "<xsl:value-of select="$filename"/>" 
                 </xsl:message> 
             </xsl:otherwise> 
         </xsl:choose> 
     </xsl:function> 
 ~~~ 

 Googling this issue states it's an issue when on Windows machines. When working with files I should prefix the file path with: file:/// with 3 slashes. When I look at the path (when processing this via the commandline and not .NET) the path is rendered as follows: **"file:/C:/data/data/..."**    However, is there a way to tell omit or include he extra slashes without doing a string replace?

Back