xsl-list
[Top] [All Lists]

Re: coodinate tranformation

2004-06-12 06:46:37
Hi,

e.g I have:gml:coordinates>0 50, 70 60, 80 90</gml:coordinates>
select="saxon:tokenize(*/gml:coordinates, '\s')"
the current result: <path d="0 50, 70 60, 80 90"/>
how can I obtain: <path d="M0 50, L 70 60, L 80 90" />

Assuming there are three coordinates then the following XSL should do it:

  <xsl:variable name="v" select="*/gml:coordinates"/>
  <xsl:variable name="vRest" select="substring-after($v, ',')"/>
  <xsl:value-of select="concat(
    'M', 
    substring-before($v, ','), 
    ', L', 
    substring-before($vRest, ','),
    ', L',
    substring-after($vRest, ',')
  )"/>

Hope that helps,
 George
-------------------------------------------------------
George Cristian Bina mailto:george(_at_)oxygenxml(_dot_)com
<oXygen/> XML Editor and XSLT Editor/Debugger
http://www.oxygenxml.com/



<Prev in Thread] Current Thread [Next in Thread>