Click here to Skip to main content
15,915,019 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: How to fix "Error Parsing Entityname" Exception Pin
Zenly12-Jan-06 14:02
Zenly12-Jan-06 14:02 
GeneralRe: How to fix "Error Parsing Entityname" Exception Pin
Curtis Schlak.13-Jan-06 1:33
Curtis Schlak.13-Jan-06 1:33 
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 
I hope this helps. You can just plop it down into the Main method of a Console application and add the appropriate using statements. If I haven't understood the problem, maybe I could help a little more with another explanation.
string inputXmlPath = @"input.xml";
string inputXslPath = @"input.xsl";
string outputFilePath = @"output.html";
string inputXml = @"<one><two><three><![CDATA[if( a < b ) {}]]></three></two></one>";
string inputXsl = @"<xsl:stylesheet version=""1.0"" xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"">" +
                    @"<xsl:template match=""three"">" +
                      @"<script>" +
                        @"<xsl:value-of disable-output-escaping=""yes"" select="".""/>" +
                      @"</script>" +
                    @"</xsl:template>" +
                  @"</xsl:stylesheet>";
StreamWriter sw = File.CreateText( inputXmlPath );
sw.Write( inputXml );
sw.Close();
sw = File.CreateText( inputXslPath );
sw.Write( inputXsl );
sw.Close();
try
{
  XslTransform trans = new XslTransform();
  trans.Load( inputXslPath );
  XmlUrlResolver resolver = new XmlUrlResolver();
  resolver.Credentials = System.Net.CredentialCache.DefaultCredentials;
  trans.Transform( inputXmlPath, outputFilePath, resolver );
}
catch( Exception e )
{
  Console.WriteLine( e.Message );
  Console.WriteLine( e.StackTrace );
}
File.Delete( inputXmlPath );
File.Delete( inputXslPath );


"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
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 
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 

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.