Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are several things wrong with the stylesheet. Taking a look at the TableNodeStyle output element for example, your context node for the <code>&lt;xsl:value-of&gt;</code> is the root of the document. You could create a new template within the stylesheet to match the <code>&lt;ysl:TableNodeStyle&gt;</code> element in the input document:</p> <pre><code>&lt;xsl:template match="TableNodeStyle"&gt; &lt;xsl:element name="TableNodeStyle"&gt; &lt;xsl:attribute name="TableRenderingOrder"&gt;&lt;xsl:value-of select="@TableRenderingOrder"/&gt;&lt;/xsl:attribute&gt; &lt;xsl:apply-templates/&gt; &lt;/xsl:element&gt; &lt;/xsl:template&gt; </code></pre> <p>Here you have a template that matches the TableNodeStyle element in the source XML and can be applied with <code>&lt;xsl:apply-templates/&gt;</code> :</p> <pre><code>&lt;xsl:template match="/"&gt; &lt;xsl:element name="graphml"&gt; &lt;xsl:element name="graph"&gt; &lt;xsl:apply-templates/&gt; &lt;/xsl:element&gt; &lt;/xsl:element&gt; &lt;/xsl:template&gt; </code></pre> <p>Second, your <code>&lt;xsl:value-of select="TableRenderingOrder"/&gt;</code> should be <code>&lt;xsl:value-of select="@TableRenderingOrder"/&gt;</code> - you need the @ to specify you're looking for an attribute in the <code>"@TableRenderingOrder"</code>.</p> <p>You can then create a template for each child element and call those, either specifically by element or by <code>&lt;xsl:call-templates/&gt;</code>.</p> <p>From looking at your original stylesheet I think it would be very useful for you to find some simple examples on the web and run through those before coming back to this problem. There should be enough that you can learn more about what you're trying to do here.</p> <p>UPDATE: OK, I've created what might be a useful stylesheet for you - it does what I think you're trying to do, and might be a good starting point for you, but I really recommend finding out how it works rather than just copying and hoping:</p> <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" xmlns:ysl="http://www.yworks.com/xml/yfiles-for-silverlight/1.0/xaml"&gt; &lt;xsl:output method="xml" indent="yes"/&gt; &lt;xsl:template match="Label"&gt; &lt;xsl:element name="Label"&gt; &lt;xsl:attribute name="LabelModelParameter"&gt;&lt;xsl:value-of select="@LabelModelParameter"/&gt;&lt;/xsl:attribute&gt; &lt;xsl:attribute name="Style"&gt;&lt;xsl:value-of select="@Style"/&gt;&lt;/xsl:attribute&gt; &lt;xsl:attribute name="PreferredSize"&gt;&lt;xsl:value-of select="@PreferredSize"/&gt;&lt;/xsl:attribute&gt; &lt;!--&lt;y:Row.Labels&gt; &lt;y:Label LabelModelParameter="{x:Static ysl:StretchStripeLabelModel.West}" Style="{y:GraphMLReference 1}" PreferredSize="72,15"&gt; &lt;y:Label.Text&gt;Development&lt;/y:Label.Text&gt;--&gt; &lt;/xsl:element&gt; &lt;/xsl:template&gt; &lt;xsl:template match="Row"&gt; &lt;xsl:element name="Row"&gt; &lt;xsl:attribute name="MinimumSize"&gt;&lt;xsl:value-of select="@MinimumSize"/&gt;&lt;/xsl:attribute&gt; &lt;xsl:attribute name="Size"&gt;&lt;xsl:value-of select="@Size"/&gt;&lt;/xsl:attribute&gt; &lt;xsl:attribute name="Insets"&gt;&lt;xsl:value-of select="@Insets"/&gt;&lt;/xsl:attribute&gt; &lt;xsl:attribute name="Style"&gt;&lt;xsl:value-of select="@Style"/&gt;&lt;/xsl:attribute&gt; &lt;xsl:apply-templates/&gt; &lt;/xsl:element&gt; &lt;/xsl:template&gt; &lt;xsl:template match="Table"&gt; &lt;xsl:element name="Table"&gt; &lt;xsl:attribute name="Insets"&gt;&lt;xsl:value-of select="@Insets"/&gt;&lt;/xsl:attribute&gt; &lt;xsl:attribute name="RelativeLocation"&gt;&lt;xsl:value-of select="@RelativeLocation"/&gt;&lt;/xsl:attribute&gt; &lt;xsl:element name="Table.Rows"&gt; &lt;xsl:apply-templates/&gt; &lt;/xsl:element&gt; &lt;/xsl:element&gt; &lt;/xsl:template&gt; &lt;xsl:template match="TableNodeStyle.Table"&gt; &lt;xsl:element name="TableNodeStyle.Table"&gt; &lt;xsl:apply-templates/&gt; &lt;/xsl:element&gt; &lt;/xsl:template&gt; &lt;xsl:template match="TableNodeStyle"&gt; &lt;xsl:element name="TableNodeStyle"&gt; &lt;xsl:attribute name="TableRenderingOrder"&gt;&lt;xsl:value-of select="@TableRenderingOrder"/&gt;&lt;/xsl:attribute&gt; &lt;xsl:apply-templates/&gt; &lt;/xsl:element&gt; &lt;/xsl:template&gt; &lt;xsl:template match="/"&gt; &lt;xsl:element name="graphml"&gt; &lt;xsl:element name="graph"&gt; &lt;xsl:apply-templates/&gt; &lt;/xsl:element&gt; &lt;/xsl:element&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload