Click here to Skip to main content
15,914,642 members
Home / Discussions / XML / XSL
   

XML / XSL

 
QuestionUnable to Load XML Pin
Samy Lahur11-Jan-06 2:32
Samy Lahur11-Jan-06 2:32 
QuestionGrouping multiple paragraph styles and multiple character styles using xsl Pin
gandhiaryah10-Jan-06 23:28
gandhiaryah10-Jan-06 23:28 
QuestionXML Serialization Pointer Fix uping Pin
asdf98910-Jan-06 9:32
asdf98910-Jan-06 9:32 
QuestionTransform to HTML with javascript Pin
Colin Angus Mackay10-Jan-06 5:18
Colin Angus Mackay10-Jan-06 5:18 
AnswerRe: Transform to HTML with javascript [Quick and dirty workaround] Pin
Colin Angus Mackay10-Jan-06 6:12
Colin Angus Mackay10-Jan-06 6:12 
AnswerRe: Transform to HTML with javascript Pin
Curtis Schlak.10-Jan-06 6:54
Curtis Schlak.10-Jan-06 6:54 
GeneralRe: Transform to HTML with javascript Pin
Colin Angus Mackay11-Jan-06 0:24
Colin Angus Mackay11-Jan-06 0:24 
GeneralRe: Transform to HTML with javascript Pin
Curtis Schlak.11-Jan-06 2:18
Curtis Schlak.11-Jan-06 2:18 
Oh, sorry! How about this? It actually makes a nice HTML file. The importan part, I think, is highlighted in yellow.
string inputXmlPath = @"input.xml";
string inputXslPath = @"input.xsl";
string outputPath = @"output.html";
string inputXml = @"<sur name=""flanders""><c name=""ned"" /><c name=""maude"" /><c name=""rod"" /><c name=""todd"" /></sur>";
string inputXsl = @"<xsl:stylesheet version=""1.0"" xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"">" +
                    @"<xsl:template match=""/"">" +
                      @"<html><head><title>Homer's Neighbors</title></head>" +
                        @"<body>" +
                          @"<h1><xsl:value-of select=""@name"" /></h1>" +
                          @"<xsl:apply-templates />" +
                        @"</body>" +
                      @"</html>" +
                    @"</xsl:template>" +
                    @"<xsl:template match=""c"">" +
                      @"<script> <span style="background-color:yellow">if( ""<xsl:value-of select=""@name"" />"".length <xsl:text disable-output-escaping=""yes""><![CDATA[<]]></xsl:text> 4 )</span> alert( ""<xsl:value-of select=""@name"" />"" );</script>" +
                    @"</xsl:template>" +
                  @"</xsl:stylesheet>";
StreamWriter sw = File.CreateText( inputXmlPath );
sw.Write( inputXml );
sw.Close();
sw = File.CreateText( inputXslPath );
sw.Write( inputXsl );
sw.Close();
XslTransform trans = new XslTransform();
trans.Load( inputXslPath );
XmlUrlResolver resolver = new XmlUrlResolver();
trans.Transform( inputXmlPath, outputPath, resolver );
File.Delete( inputXmlPath );
File.Delete( inputXslPath );


"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
QuestionHelp with assignment question please! Pin
R0ssini9-Jan-06 11:30
R0ssini9-Jan-06 11:30 
AnswerRe: Help with assignment question please! Pin
Christian Graus9-Jan-06 11:55
protectorChristian Graus9-Jan-06 11:55 
GeneralRe: Help with assignment question please! Pin
R0ssini9-Jan-06 12:03
R0ssini9-Jan-06 12:03 
GeneralRe: Help with assignment question please! Pin
Christian Graus9-Jan-06 12:09
protectorChristian Graus9-Jan-06 12:09 
GeneralRe: Help with assignment question please! Pin
R0ssini9-Jan-06 12:23
R0ssini9-Jan-06 12:23 
GeneralRe: Help with assignment question please! Pin
Christian Graus9-Jan-06 12:26
protectorChristian Graus9-Jan-06 12:26 
GeneralRe: Help with assignment question please! Pin
R0ssini9-Jan-06 12:37
R0ssini9-Jan-06 12:37 
GeneralRe: Help with assignment question please! Pin
R0ssini11-Jan-06 0:47
R0ssini11-Jan-06 0:47 
GeneralRe: Help with assignment question please! Pin
R0ssini11-Jan-06 0:51
R0ssini11-Jan-06 0:51 
GeneralRe: Help with assignment question please! Pin
R0ssini11-Jan-06 0:58
R0ssini11-Jan-06 0:58 
GeneralRe: Help with assignment question please! Pin
Itech Consulting26-Jan-06 15:03
Itech Consulting26-Jan-06 15:03 
GeneralRe: Help with assignment question please! Pin
Itech Consulting26-Jan-06 15:06
Itech Consulting26-Jan-06 15:06 
AnswerRe: Help with assignment question please! Pin
Mike Burroughs12-Jan-06 14:57
Mike Burroughs12-Jan-06 14:57 
GeneralRe: Help with assignment question please! Pin
R0ssini13-Jan-06 14:53
R0ssini13-Jan-06 14:53 
QuestionProblem with xslt. Pin
Chetan Ranpariya5-Jan-06 18:54
Chetan Ranpariya5-Jan-06 18:54 
QuestionInsert string to Bitmap path? Pin
SpeBeeTo5-Jan-06 14:03
SpeBeeTo5-Jan-06 14:03 
AnswerRe: Insert string to Bitmap path? Pin
Curtis Schlak.6-Jan-06 7:31
Curtis Schlak.6-Jan-06 7:31 

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.