Click here to Skip to main content
16,010,334 members
Home / Discussions / XML / XSL
   

XML / XSL

 
AnswerRe: Modifying an XML node value Pin
remyaramamurthi16-Mar-06 19:25
remyaramamurthi16-Mar-06 19:25 
QuestionCreating xml based documantation/help file Pin
HL_SUB12-Mar-06 0:58
HL_SUB12-Mar-06 0:58 
QuestionException when reading xml file??? Pin
richiemac10-Mar-06 7:07
richiemac10-Mar-06 7:07 
AnswerRe: Exception when reading xml file??? Pin
George L. Jackson13-Mar-06 12:27
George L. Jackson13-Mar-06 12:27 
GeneralThanks Pin
richiemac14-Mar-06 5:04
richiemac14-Mar-06 5:04 
QuestionDynamic model using XML Pin
peepys10-Mar-06 4:27
peepys10-Mar-06 4:27 
AnswerRe: Dynamic model using XML Pin
George L. Jackson17-Mar-06 14:49
George L. Jackson17-Mar-06 14:49 
QuestionConvert DataSet to SpreedsheetML using XSLT Pin
Danilo Corallo10-Mar-06 1:13
Danilo Corallo10-Mar-06 1:13 
Hi to everybody,
I need some help D'Oh! | :doh: to convert a XML DataSet to an Excel file. I actually using this code:

Private Sub TransformXML(ByVal xmlDoc As XmlDataDocument, _
ByVal strXSLPath As String, _
ByVal strSavePath As String)

  Dim xt As New XslCompiledTransform
  Dim tw As XmlTextWriter
  tw = New XmlTextWriter(strSavePath, System.Text.Encoding.UTF8)
  tw.Formatting = Formatting.Indented
  tw.Indentation = 3
  tw.WriteStartDocument()
  xt.Load(My.Application.Info.DirectoryPath & strXSLPath)
  xt.Transform(xmlDoc, Nothing, tw)
  tw.Close()

End Sub


The XSLT follow here Sniff | :^) :

<xsl:stylesheet version="1.0"
xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:user="urn:my-scripts"
xmlnsBlush | :O ="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" >

<xsl:template match="/">
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlnsBlush | :O ="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<xsl:apply-templates/>
</Workbook>
</xsl:template>

<xsl:template match="/*">
<Worksheet>
<xsl:attribute name="ss:Name">
<xsl:value-of select="local-name(/*/*)"/>
</xsl:attribute>
<Table x:FullColumns="1" x:FullRows="1">
<Row>
<xsl:for-each select="*[position() = 1]/*">
<Cell>
<Data ss:Type="String">
<xsl:value-of select="local-name()"/>
</Data>
</Cell>
</xsl:for-each>
</Row>
<xsl:apply-templates/>
</Table>
</Worksheet>
</xsl:template>

<xsl:template match="/*/*">
<Row>
<xsl:apply-templates/>
</Row>
</xsl:template>

<xsl:template match="/*/*/*">
<Cell>
<Data ss:Type="String">
<xsl:value-of select="."/>
</Data>
</Cell>
</xsl:template>

</xsl:stylesheet>


The problem is that the XSLT must be generic because the DataSet it's always different. I would like to retrieve the datatype from the DataSet schema and create the Excel file properly. The XSLT attached perform only a simple transformation.

Can anyone help me with XSLT and kindly provide a better implementation?

Thanks in advance to anyone will replay Smile | :)
AnswerRe: Convert DataSet to SpreedsheetML using XSLT Pin
Ron.S16-Mar-06 23:51
Ron.S16-Mar-06 23:51 
GeneralRe: Convert DataSet to SpreedsheetML using XSLT Pin
Danilo Corallo17-Mar-06 0:03
Danilo Corallo17-Mar-06 0:03 
QuestionProgramming with the XMLDom in C# Pin
ncotton9-Mar-06 23:40
ncotton9-Mar-06 23:40 
QuestionI Want Voip Concept and avilable web sites Pin
Pagididpalli9-Mar-06 22:04
Pagididpalli9-Mar-06 22:04 
Questionwhat is XML? Pin
Areff9-Mar-06 2:37
Areff9-Mar-06 2:37 
AnswerRe: what is XML? Pin
Hamid_RT9-Mar-06 18:05
Hamid_RT9-Mar-06 18:05 
GeneralRe: what is XML? Pin
Areff9-Mar-06 20:03
Areff9-Mar-06 20:03 
AnswerRe: what is XML? Pin
HimaBindu Vejella14-Mar-06 0:17
HimaBindu Vejella14-Mar-06 0:17 
QuestionAdd Image in XML Pin
LovelyHelp9-Mar-06 0:31
LovelyHelp9-Mar-06 0:31 
AnswerRe: Add Image in XML Pin
LovelyHelp14-Mar-06 23:24
LovelyHelp14-Mar-06 23:24 
QuestionDataTable.WriteXML gives incorrect output Pin
magja7-Mar-06 4:01
magja7-Mar-06 4:01 
Questionxmldom Pin
Hamid_RT7-Mar-06 0:28
Hamid_RT7-Mar-06 0:28 
AnswerRe: xmldom Pin
imsathy7-Mar-06 19:34
imsathy7-Mar-06 19:34 
GeneralRe: xmldom Pin
Hamid_RT7-Mar-06 20:18
Hamid_RT7-Mar-06 20:18 
QuestionHow to get the datatype of an XML element using C# Pin
Enigma34404-Mar-06 2:50
Enigma34404-Mar-06 2:50 
AnswerRe: How to get the datatype of an XML element using C# Pin
Denevers31-Mar-06 18:01
Denevers31-Mar-06 18:01 
Question"unable to establish connection to network" exception Pin
amresawy2-Mar-06 10:08
amresawy2-Mar-06 10:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.