Hello All,
This is my first post on this forum site.
I am writing an xslt to convert an xml to another xml. But I am having issues with the results. First is the xml snippet I am working from, second is my xslt so far and finally the resultant xml file content.
Code:<data key="d3"> <ysl:TableNodeStyle TableRenderingOrder="RowsFirst"> <ysl:TableNodeStyle.Table> <y:Table Insets="30,0,0,0" RelativeLocation="0,0"> <y:Table.Rows> <y:Row MinimumSize="10" Size="185.389513343799" Insets="30,0,0,0" Style="{y:GraphMLReference 2}"> <y:Row.Labels> <y:Label LabelModelParameter="{x:Static ysl:StretchStripeLabelModel.West}" Style="{y:GraphMLReference 1}" PreferredSize="72,15"> <y:Label.Text>Development</y:Label.Text> </y:Label> </y:Row.Labels> </y:Row>Code:<?xml version="1.0" encoding="utf-8"?> <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" > <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <xsl:element name="graphml"> <xsl:element name="graph"> <xsl:element name="TableNodeStyle"> <xsl:attribute name="TableRenderingOrder"><xsl:value-of select="TableRenderingOrder"/></xsl:attribute> <xsl:element name="TableNodeStyle.Table"> <xsl:element name="Table"> <xsl:attribute name="Table"><xsl:value-of select="Table"/></xsl:attribute> <xsl:element name="Table.Rows"> <xsl:element name="Row"> <xsl:attribute name="Row"><xsl:value-of select="Row"/></xsl:attribute> <xsl:element name="Label"> <xsl:attribute name="Label"><xsl:value-of select="Label"/></xsl:attribute> <!--<y:Row.Labels> <y:Label LabelModelParameter="{x:Static ysl:StretchStripeLabelModel.West}" Style="{y:GraphMLReference 1}" PreferredSize="72,15"> <y:Label.Text>Development</y:Label.Text>--> </xsl:element> </xsl:element> </xsl:element> </xsl:element> </xsl:element> </xsl:element> </xsl:element> </xsl:element> </xsl:template> </xsl:stylesheet>This is not looking as it should. Is my code way off?Code:<?xml version="1.0" encoding="utf-8"?> <graphml> <graph> <TableNodeStyle TableRenderingOrder=""> <TableNodeStyle.Table> <Table Table=""> <Table.Rows> <Row Row=""> <Label Label="" /> </Row> </Table.Rows> </Table> </TableNodeStyle.Table> </TableNodeStyle> </graph> </graphml>
Any thoughts most appreciated.


Reply With Quote
Bookmarks