[xsl] XML-to-XML question

Subject: [xsl] XML-to-XML question
From: Wolfgang Bogacz <wbogacz@xxxxxxxxxxx>
Date: Mon, 26 Feb 2001 14:24:09 -0500
I've been fairly successful having my transformations write out into HTML
files through XT
so I can validate the output, but now i'd like to change my output mode to
XML.
This yields alot of character problems right from the start.

This is the starting part of the incoming file:

<?xml version="1.0"?>
<svg width="100%" height="100%" viewBox="0 0 1264 857" style="fill:teal">

This is my starting module:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">

<xsl:include href="g.xsl"/>
...more includes...
<xsl:include href="tokenize_styles.xsl"/>

<xsl:output method="xml" indent="no"/>

<xsl:template match="svg">
 &lt; svg
  <xsl:if test="string-length(normalize-space(@style)) != 0">
   <xsl:call-template name="tokenize_styles">
    <xsl:with-param name="parse-string"
 
select="concat(normalize-space(translate(@style,'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
,'abcdefghijklmnopqrstuvwxyz')),';')"/>
    <xsl:with-param name="symbol-string" select="'svg'"/>
   </xsl:call-template>
  </xsl:if>
 &gt;
 <xsl:apply-templates/>
 &lt;/svg&gt; 
</xsl:template>

</xsl:stylesheet>

When this was output as "html" I would get something like &lt;svg
width="100%" height="100%" viewBox="0 0 1264 857" fill="teal"&gt
which would show as <svg width="100%" height="100%" viewBox="0 0 1264 857"
fill="teal">, so I was happy. 

However, now my transform for xml kills me right after the template match,
though I've tried embedding the
&lt; and &gt; within concat statements, such as: <xsl:value-of
select="concat(&lt;,'svg ')"/> or <xsl:value-of
select="concat(&lt;,'/svg',&gt;)"/> for the last.
Am I far off? I seem to have trouble getting the foot in the door.

Thanks for any help.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread