Click here to Skip to main content
15,889,693 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: How to get Microsoft Infopath XML generated file to work with the Web? Pin
Sandy_L_Schultz19-Jul-09 12:43
Sandy_L_Schultz19-Jul-09 12:43 
GeneralRe: How to get Microsoft Infopath XML generated file to work with the Web? Pin
Member 120804822-Jul-09 8:52
Member 120804822-Jul-09 8:52 
QuestionHow to calling GetObject() in XML? Pin
whiteclouds14-Jul-09 17:10
whiteclouds14-Jul-09 17:10 
AnswerRe: How to calling GetObject() in XML? Pin
Roll#114-Jul-09 21:10
Roll#114-Jul-09 21:10 
GeneralRe: How to calling GetObject() in XML? Pin
whiteclouds19-Jul-09 20:21
whiteclouds19-Jul-09 20:21 
QuestionValidate Xml without using xmlns Pin
tprakash14-Jul-09 2:05
tprakash14-Jul-09 2:05 
AnswerRe: Validate Xml without using xmlns Pin
Stuart Dootson14-Jul-09 2:36
professionalStuart Dootson14-Jul-09 2:36 
AnswerRe: Validate Xml without using xmlns Pin
Roll#114-Jul-09 21:25
Roll#114-Jul-09 21:25 
QuestionNeed help arguing *against* XML for localization storage. Pin
James Trudel13-Jul-09 10:40
James Trudel13-Jul-09 10:40 
AnswerRe: Need help arguing *against* XML for localization storage. Pin
Stuart Dootson13-Jul-09 13:19
professionalStuart Dootson13-Jul-09 13:19 
QuestionDifferent XSD representation of an element. Pin
Comp_Users11-Jul-09 7:12
Comp_Users11-Jul-09 7:12 
AnswerRe: Different XSD representation of an element. Pin
Stuart Dootson11-Jul-09 7:38
professionalStuart Dootson11-Jul-09 7:38 
GeneralRe: Different XSD representation of an element. Pin
Comp_Users13-Jul-09 0:54
Comp_Users13-Jul-09 0:54 
Questionhow to use select result in another select [modified] Pin
daveyerwin9-Jul-09 4:19
daveyerwin9-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
daveyerwin9-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
Fadi 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
Fadi Yoosuf8-Jul-09 20:40 
Thank you Stuart

But can you clarify some more things?

My xml file is
<?xml version="1.0" encoding="utf-8" ?>
<bookstore>
  <book genre="autobiography" publicationdate="1981" ISBN="1-861003-11-0">
    <title>The Autobiography of Benjamin Franklin</title>
    <author>
      <first-name>Benjamin</first-name>
      <last-name>Franklin</last-name>
    </author>
    <price>8.99</price>
  </book>
  <book genre="novel" publicationdate="1967" ISBN="0-201-63361-2">
    <title>The Confidence Man</title>
    <author>
      <first-name>Herman</first-name>
      <last-name>Melville</last-name>
    </author>
    <price>11.99</price>
  </book>
  <book genre="philosophy" publicationdate="1991" ISBN="1-861001-57-6">
    <title>The Gorgias</title>
    <author>
      <name>Plato</name>
    </author>
    <price>9.99</price>
  </book>
</bookstore>



My xslt file is
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:output="urn:output">

  <xsl:template match="bookstore">
    <bookstore>
      <xsl:for-each select="book">
        <book>
          <xsl:copy-of select="node()"/>
          <new-price>
            <xsl:value-of select="output:SaveOutput(@genre, node())"/>
          </new-price>
        </book>
      </xsl:for-each>
    </bookstore>
  </xsl:template>
</xsl:stylesheet>



C# code goes like
private void ExtensionTest()
{
            XslCompiledTransform xslt = new XslCompiledTransform();
            xslt.Load("extension.xslt");
            XsltArgumentList xslArg = new XsltArgumentList();

            OutputSaver obj = new OutputSaver();
            xslArg.AddExtensionObject("urn:output", obj);
            using (XmlWriter w = XmlWriter.Create("output.xml"))
            {
                xslt.Transform("books.xml", xslArg, w);
            }
}
 public class OutputSaver
 {
        public void SaveOutput(string fileName, string node)
        {
            StreamWriter s = new StreamWriter(fileName);
            s.Write(node);
            s.Flush();
        }
 }


Now I have 2 issues
* How to pass the xslt node content to SaveOutput method in c#
* How avoid specifying an output file in Trnasform method of XslCompiledTransform (This is to avoid generating an addtional file with the files generated using extennsion method)

Thank you
Fadi
GeneralRe: Generating multiple files using XSLT 1.0 Pin
Fadi Yoosuf8-Jul-09 20:45
Fadi Yoosuf8-Jul-09 20:45 
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
bbm2k35-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
ksss_maheshece3-Jul-09 2:05 

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.