Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. XSLT

XSLT

Scheduled Pinned Locked Moved XML / XSL
xmlhelpquestion
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Daredeviljpr
    wrote on last edited by
    #1

    :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

    C 1 Reply Last reply
    0
    • D Daredeviljpr

      :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

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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

      D 1 Reply Last reply
      0
      • C Christian Graus

        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

        D Offline
        D Offline
        Daredeviljpr
        wrote on last edited by
        #3

        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.

        S 1 Reply Last reply
        0
        • D Daredeviljpr

          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.

          S Offline
          S Offline
          Stuart Dootson
          wrote on last edited by
          #4

          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'

          D 1 Reply Last reply
          0
          • S Stuart Dootson

            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'

            D Offline
            D Offline
            Daredeviljpr
            wrote on last edited by
            #5

            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

            D H 2 Replies Last reply
            0
            • D Daredeviljpr

              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

              D Offline
              D Offline
              Daredeviljpr
              wrote on last edited by
              #6

              Sorry, it was my mistake in the Code, I was writing the dataset also in the output file. It is resolved now.

              1 Reply Last reply
              0
              • D Daredeviljpr

                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

                H Offline
                H Offline
                hp108
                wrote on last edited by
                #7

                # Adding a carriage return (WITHOUT SPACES): & # x 0 D ; # Adding a line feed (WITHOUT SPACES): & # x 0 A ; & # x 0 A ; YOU DO NOT NEED Function ReturnCharacter return VbCrlf End Function

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups