?
=?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=
Hello,
I've been looking at this for a bit now and I don't see what's wrong
with the code. Can anybody see a problem with this?
Here is an XSLT snippet I use.
<xsl:template match="graphic">
<xslaram name="path" />
<fo:block padding-after="12pt">
<xsl:variable name="xml-name">
<xsl:value-of select="substring-before(substring-after(@source,
'/'), '_Images')"/>.xml
</xsl:variable>
<xsl:variable name="image-path-name">
<xsl:value-of select="substring-after(@source, '/')" />
</xsl:variable>
<xsl:variable name="graphic-path">
<xsl:value-of select="substring-before($path, $xml-name)"
/><xsl:value-of select="$image-path-name" />
</xsl:variable>
<fo:block><xsl:value-of select="$path" /></fo:block>
<fo:block><xsl:value-of select="$xml-name" /></fo:block>
<fo:block><xsl:value-of select="$image-path-name" /></fo:block>
<fo:block><xsl:value-of select="substring-before($path,
$xml-name)" /></fo:block>
<fo:external-graphic src="url({$graphic-path})"/>
<xsl:value-of select="$graphic-path" />
</fo:block>
</xsl:template>
This is the output on the PDF.
../User_Guide_XML/Applicability_Menu/Insert_Applicability.xml
Insert_Applicability.xml
Insert_Applicability_Images/Fig-3.jpg
Insert_Applicability_Images/Fig-3.jpg
You would think that substring-before($path, $xml-name) would give me
"./User_Guide_XML/Applicability_Menu/", but it doesn't seem to work. If
I replace $xml-name in substring-before with an actual string, it seems
to work. What am I missing here? I was using 2 variables before trying
this trick in the substring-before and it didn't cause any problems
then. What's changed?
This is a snippet of the input XML (path contains the section id
attribute value:
<section id="./User_Guide_XML/File_Menu/Close_All_Documents.xml">
<title>
<bold>Closing All Documents</bold>
</title>
<graphic source="./Close_All_Documents_Images/Fig-1.jpg"/>
</section>
Regards
Jean-Francois Michaud
I've been looking at this for a bit now and I don't see what's wrong
with the code. Can anybody see a problem with this?
Here is an XSLT snippet I use.
<xsl:template match="graphic">
<xslaram name="path" />
<fo:block padding-after="12pt">
<xsl:variable name="xml-name">
<xsl:value-of select="substring-before(substring-after(@source,
'/'), '_Images')"/>.xml
</xsl:variable>
<xsl:variable name="image-path-name">
<xsl:value-of select="substring-after(@source, '/')" />
</xsl:variable>
<xsl:variable name="graphic-path">
<xsl:value-of select="substring-before($path, $xml-name)"
/><xsl:value-of select="$image-path-name" />
</xsl:variable>
<fo:block><xsl:value-of select="$path" /></fo:block>
<fo:block><xsl:value-of select="$xml-name" /></fo:block>
<fo:block><xsl:value-of select="$image-path-name" /></fo:block>
<fo:block><xsl:value-of select="substring-before($path,
$xml-name)" /></fo:block>
<fo:external-graphic src="url({$graphic-path})"/>
<xsl:value-of select="$graphic-path" />
</fo:block>
</xsl:template>
This is the output on the PDF.
../User_Guide_XML/Applicability_Menu/Insert_Applicability.xml
Insert_Applicability.xml
Insert_Applicability_Images/Fig-3.jpg
Insert_Applicability_Images/Fig-3.jpg
You would think that substring-before($path, $xml-name) would give me
"./User_Guide_XML/Applicability_Menu/", but it doesn't seem to work. If
I replace $xml-name in substring-before with an actual string, it seems
to work. What am I missing here? I was using 2 variables before trying
this trick in the substring-before and it didn't cause any problems
then. What's changed?
This is a snippet of the input XML (path contains the section id
attribute value:
<section id="./User_Guide_XML/File_Menu/Close_All_Documents.xml">
<title>
<bold>Closing All Documents</bold>
</title>
<graphic source="./Close_All_Documents_Images/Fig-1.jpg"/>
</section>
Regards
Jean-Francois Michaud