Re: State diagrame with code export

Hi, Steffen
Thanks for your answer and for the xsltproc link.

I' ve seen the differencies between my file and dia-uml2cpp.xsl. but I think's its ok because :
<xsl:output method="text"/>   <-  output file (it's xml for me)

I don't use thes parameters :
<xsl:param name="directory"/>
<xsl:param name="indentation"><xsl:text>  </xsl:text></xsl:param>

<xsl:template match="dia-uml">
The dia file what I want convert does'nt contain the "dia-uml" markup

I've tried to add the xsl namespace and to remove dia: prefixes but without changes...
This is the beginning of my file (with one template, if it works for this one, it works for all !) :

<xsl:stylesheet xmlns:xsl=""
  <xsl:output method="xml" indent="yes" encoding="ISO-8859-1"/>

  <xsl:template match="/">
    <xsl:element name="scxml">
      <xsl:apply-templates select="//dia:object[ type='UML - State Term']"/>

  <xsl:template match="//dia:object[ type='UML - State Term'] ">
      <xsl:when test="dia:attribute[ name='is_final']/dia:boolean[ val='true']">
        <xsl:element name="final">
          <xsl:attribute name="id"><xsl:value-of select="concat('fin_',@id)"/></xsl:attribute>
        <xsl:element name="state">
          <xsl:attribute name="id">initial</xsl:attribute>
          <xsl:apply-templates select="//dia:object[ type='UML - Transition'] ">                   <xsl:with-param name="idEtatCourant" select="@id"/>

Regards, David

2009/4/21 Steffen Macke <sdteffen gmail com>
Hi David,

thanks for sharing the code. If you look e.g. at dia-uml2cpp.xsl, which is part
of the Dia distribution, you'll notice a number of differences
compared to your code
(I've removed comments):

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="" version="1.0">
       <xsl:output method="text"/>
       <xsl:param name="directory"/>
       <xsl:param name="indentation"><xsl:text>  </xsl:text></xsl:param>

       <xsl:template match="dia-uml">

In case the snippet you provided was incomplete, please provide the
complete file(s).
Some hints:

* Provide the xsl namespace.
* omit the "dia:" prefix

Did you try debugging using xsltproc?
Maybe the Visual xsltproc debugger can help you:



>  <xsl:template match="/">
>     <xsl:element name="dia-uml">
>       <xsl:apply-templates select="dia:object[ type='UML - State']"/>
>     </xsl:element>
>   </xsl:template>
>   <xsl:template match="dia:object[ type='UML - State']">
>     <xsl:element name="etat">
>     </xsl:element>
>   </xsl:template>
dia-list mailing list
dia-list gnome org
FAQ at
Main page at

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]