XSLT
-
:confused:I want to transform dataset data to a text file. I am doing it using XSLT. It is getting transformed but rows are displayed one after the other not on a new line. How do I insert a New line character after each row in the text file. Is there any other way to export data from a dataset to a text file. The text file will be a fixed length test file. Please help me as soon as possible
-
:confused:I want to transform dataset data to a text file. I am doing it using XSLT. It is getting transformed but rows are displayed one after the other not on a new line. How do I insert a New line character after each row in the text file. Is there any other way to export data from a dataset to a text file. The text file will be a fixed length test file. Please help me as soon as possible
Why are you using XSLT ? Surely you can just iterate through the rows without turning the dataset to an XML document ? Then you can use Environment.Newline to stuff a line in between. You can also just put a return in your XSLT though, that should work. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
-
Why are you using XSLT ? Surely you can just iterate through the rows without turning the dataset to an XML document ? Then you can use Environment.Newline to stuff a line in between. You can also just put a return in your XSLT though, that should work. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
I have lacs of records and it will take lot of time to iterate through each record. What does "return" mean in the statement "You can also just put a return in your XSLT though, that should work." If I write "return" in XSLT it will simply write return in the text file.
-
I have lacs of records and it will take lot of time to iterate through each record. What does "return" mean in the statement "You can also just put a return in your XSLT though, that should work." If I write "return" in XSLT it will simply write return in the text file.
Dinesh Thakan wrote: I have lacs of records and it will take lot of time to iterate through each record. That's all the XSLT is doing.... Dinesh Thakan wrote: What does "return" mean in the statement "You can also just put a return in your XSLT though, that should work." Christian means a 'carriage-return'. If you put the numeric entities
into your XSLT, that should insert a new-line? Stuart Dootson 'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p' -
Dinesh Thakan wrote: I have lacs of records and it will take lot of time to iterate through each record. That's all the XSLT is doing.... Dinesh Thakan wrote: What does "return" mean in the statement "You can also just put a return in your XSLT though, that should work." Christian means a 'carriage-return'. If you put the numeric entities
into your XSLT, that should insert a new-line? Stuart Dootson 'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'Thanks Christian Graus and Stuart Dootson for your support. I was able to get the line feed in my text file. Now there is another problem, the XML gets written in my text file after the transformed data. The xsl being used is given below. Function ReturnCharacter return VbCrlf End Function The OutPut is: In the output you can see the xml appended at the last. I do not want thi sXML in my text document. What should I do. TRAIHTrail's Head Gourmet ProvisionersHelvetius NagyUSA(206) 555-8257 VAFFEVaffeljernetPalle IbsenDenmark86 21 32 43 VICTEVictuailles en stockMary SaveleyFrance78.32.54.86 VINETVins et alcools ChevalierPaul HenriotFrance26.47.15.10 WANDKDie Wandernde KuhRita MüllerGermany0711-020361 WARTHWartian HerkkuPirkko KoskitaloFinland981-443655 WELLIWellington ImportadoraPaula ParenteBrazil(14) 555-8122 WHITCWhite Clover MarketsKarl JablonskiUSA(206) 555-4112 WILMKWilman KalaMatti KarttunenFinland90-224 8858 WOLZAWolski ZajazdZbyszek PiestrzeniewiczPoland(26) 642-7012 ALFKIAlfreds FutterkisteMaria AndersGermany030-0074321
ANATRAna Trujillo Emparedados y heladosAna TrujilloMexico(5) 555-4729
ANTONAntonio Moreno TaqueríaAntonio MorenoMexico(5) 555-3932
AROUTAround the HornThomas HardyUK(171) 555-7788
BERGS
-
Thanks Christian Graus and Stuart Dootson for your support. I was able to get the line feed in my text file. Now there is another problem, the XML gets written in my text file after the transformed data. The xsl being used is given below. Function ReturnCharacter return VbCrlf End Function The OutPut is: In the output you can see the xml appended at the last. I do not want thi sXML in my text document. What should I do. TRAIHTrail's Head Gourmet ProvisionersHelvetius NagyUSA(206) 555-8257 VAFFEVaffeljernetPalle IbsenDenmark86 21 32 43 VICTEVictuailles en stockMary SaveleyFrance78.32.54.86 VINETVins et alcools ChevalierPaul HenriotFrance26.47.15.10 WANDKDie Wandernde KuhRita MüllerGermany0711-020361 WARTHWartian HerkkuPirkko KoskitaloFinland981-443655 WELLIWellington ImportadoraPaula ParenteBrazil(14) 555-8122 WHITCWhite Clover MarketsKarl JablonskiUSA(206) 555-4112 WILMKWilman KalaMatti KarttunenFinland90-224 8858 WOLZAWolski ZajazdZbyszek PiestrzeniewiczPoland(26) 642-7012 ALFKIAlfreds FutterkisteMaria AndersGermany030-0074321
ANATRAna Trujillo Emparedados y heladosAna TrujilloMexico(5) 555-4729
ANTONAntonio Moreno TaqueríaAntonio MorenoMexico(5) 555-3932
AROUTAround the HornThomas HardyUK(171) 555-7788
BERGS
Sorry, it was my mistake in the Code, I was writing the dataset also in the output file. It is resolved now.
-
Thanks Christian Graus and Stuart Dootson for your support. I was able to get the line feed in my text file. Now there is another problem, the XML gets written in my text file after the transformed data. The xsl being used is given below. Function ReturnCharacter return VbCrlf End Function The OutPut is: In the output you can see the xml appended at the last. I do not want thi sXML in my text document. What should I do. TRAIHTrail's Head Gourmet ProvisionersHelvetius NagyUSA(206) 555-8257 VAFFEVaffeljernetPalle IbsenDenmark86 21 32 43 VICTEVictuailles en stockMary SaveleyFrance78.32.54.86 VINETVins et alcools ChevalierPaul HenriotFrance26.47.15.10 WANDKDie Wandernde KuhRita MüllerGermany0711-020361 WARTHWartian HerkkuPirkko KoskitaloFinland981-443655 WELLIWellington ImportadoraPaula ParenteBrazil(14) 555-8122 WHITCWhite Clover MarketsKarl JablonskiUSA(206) 555-4112 WILMKWilman KalaMatti KarttunenFinland90-224 8858 WOLZAWolski ZajazdZbyszek PiestrzeniewiczPoland(26) 642-7012 ALFKIAlfreds FutterkisteMaria AndersGermany030-0074321
ANATRAna Trujillo Emparedados y heladosAna TrujilloMexico(5) 555-4729
ANTONAntonio Moreno TaqueríaAntonio MorenoMexico(5) 555-3932
AROUTAround the HornThomas HardyUK(171) 555-7788
BERGS