Click here to Skip to main content
14,869,122 members
Home / Discussions / XML / XSL
   

XML / XSL

 
Questionhow to use select result in another select [modified] Pin
daveyerwin9-Jul-09 4:19
Memberdaveyerwin9-Jul-09 4:19 
AnswerRe: how to use select result in another select Pin
Jeremy Likness9-Jul-09 7:40
professionalJeremy Likness9-Jul-09 7:40 
GeneralRe: how to use select result in another select Pin
daveyerwin9-Jul-09 9:02
Memberdaveyerwin9-Jul-09 9:02 
AnswerRe: how to use select result in another select Pin
Stuart Dootson9-Jul-09 13:03
professionalStuart Dootson9-Jul-09 13:03 
QuestionGenerating multiple files using XSLT 1.0 Pin
Fadi Yoosuf8-Jul-09 5:33
MemberFadi Yoosuf8-Jul-09 5:33 
AnswerRe: Generating multiple files using XSLT 1.0 Pin
Stuart Dootson8-Jul-09 7:27
professionalStuart Dootson8-Jul-09 7:27 
GeneralRe: Generating multiple files using XSLT 1.0 Pin
Fadi Yoosuf8-Jul-09 20:40
MemberFadi Yoosuf8-Jul-09 20:40 
GeneralRe: Generating multiple files using XSLT 1.0 Pin
Fadi Yoosuf8-Jul-09 20:45
MemberFadi Yoosuf8-Jul-09 20:45 
I got one more query. Will it be possible by embedding script in xslt?

I tried the following way

Xslt file
?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:user="urn:myscripts"
>
    <xsl:output method="xml" indent="yes"/>

  <msxsl:script language="C#" implements-prefix="user">
    <![CDATA[
    public void SaveOutput(string fileName)
    {
    
      System.IO.TextWriter t = new System.IO.StreamWriter(fileName);
      t.Write("got it");
      t.Flush();
    }
    ]]>
  </msxsl:script>


  <xsl:template match="@* | node()">
    <xsl:value-of select="user:SaveOutput('d:\testing.txt')"/>
        
    </xsl:template>
</xsl:stylesheet>



My C# code is
private void ScriptTest()
{
    XsltSettings settings = new XsltSettings();
    settings.EnableScript = true;

    XslCompiledTransform trs = new XslCompiledTransform();
    trs.Load("Custom.xslt", settings, new XmlUrlResolver());
    StreamWriter writer = new StreamWriter(@"e:\samples.txt");
    trs.Transform(@"E:\\9.xml", null, writer);

    writer.Flush();
    writer.Close();
}



But when I run the code, I get en error like
IOException unhandled - The device is not ready

Thank you
Fadi
GeneralRe: Generating multiple files using XSLT 1.0 Pin
Stuart Dootson9-Jul-09 0:23
professionalStuart Dootson9-Jul-09 0:23 
QuestionXSL Sort Pin
bbm2k35-Jul-09 9:31
Memberbbm2k35-Jul-09 9:31 
AnswerRe: XSL Sort Pin
Stuart Dootson5-Jul-09 11:51
professionalStuart Dootson5-Jul-09 11:51 
QuestionRss Implemetation Pin
ksss_maheshece3-Jul-09 2:05
Memberksss_maheshece3-Jul-09 2:05 
AnswerRe: Rss Implemetation Pin
DoctorMick3-Jul-09 2:41
MemberDoctorMick3-Jul-09 2:41 
GeneralRe: Rss Implemetation [modified] Pin
ksss_maheshece3-Jul-09 2:55
Memberksss_maheshece3-Jul-09 2:55 
GeneralRe: Rss Implemetation Pin
Stuart Dootson3-Jul-09 3:44
professionalStuart Dootson3-Jul-09 3:44 
AnswerRe: Rss Implemetation Pin
K03063-Jul-09 18:53
MemberK03063-Jul-09 18:53 
GeneralRe: Rss Implemetation Pin
ksss_maheshece3-Jul-09 21:50
Memberksss_maheshece3-Jul-09 21:50 
Questiondesktop news ticker Pin
dahras2-Jul-09 8:43
Memberdahras2-Jul-09 8:43 
QuestionRunning an exe file Pin
Bram van Kampen1-Jul-09 14:52
MemberBram van Kampen1-Jul-09 14:52 
AnswerRe: Running an exe file Pin
Stuart Dootson1-Jul-09 21:26
professionalStuart Dootson1-Jul-09 21:26 
GeneralRe: Running an exe file Pin
Bram van Kampen1-Jul-09 22:30
MemberBram van Kampen1-Jul-09 22:30 
QuestionEmpty value is passed while reading value from an XML node Pin
Mahesh.J29-Jun-09 19:11
MemberMahesh.J29-Jun-09 19:11 
AnswerRe: Empty value is passed while reading value from an XML node Pin
Stuart Dootson29-Jun-09 22:20
professionalStuart Dootson29-Jun-09 22:20 
GeneralRe: Empty value is passed while reading value from an XML node Pin
Mahesh.J29-Jun-09 23:05
MemberMahesh.J29-Jun-09 23:05 
GeneralRe: Empty value is passed while reading value from an XML node Pin
Stuart Dootson30-Jun-09 3:10
professionalStuart Dootson30-Jun-09 3:10 

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.