Question on XSLT

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • RJN

    #1

    Question on XSLT


    Hi

    Pardon me for posting an XML question here.
    Can XSLT be applied for transforming .txt files or are they applicable
    only for xml to xml transformation.

    Currently all the clients send file to a server in one particular
    format. The format of the file which the server accepts is going to
    change. So we need to build an intermediate system which will do the
    transformation from the old format to the new format. Can I use XSLT for
    doing this? Is XSLT applicable only when xml to xml transformation is
    involved?

    Regards

    rjn

    *** Sent via Developersdex http://www.developersdex.com ***
  • _AnonCoward

    #2
    Re: Question on XSLT


    "RJN" <rjn@yahoo.co m> wrote in message
    news:eDiMbFvWFH A.1404@TK2MSFTN GP09.phx.gbl...
    :
    : Hi
    :
    : Pardon me for posting an XML question here.
    : Can XSLT be applied for transforming .txt files or are they applicable
    : only for xml to xml transformation.
    :
    : Currently all the clients send file to a server in one particular
    : format. The format of the file which the server accepts is going to
    : change. So we need to build an intermediate system which will do the
    : transformation from the old format to the new format. Can I use XSLT
    for
    : doing this? Is XSLT applicable only when xml to xml transformation is
    : involved?
    :
    : Regards
    :
    : rjn
    :


    You can only use XSL to parse XML documents. You are much more flexible
    with the output format.


    One approach would be to manually parse your input files into an XML
    document with a predetermined structure. Then, use XSL to parse that
    intermediate form into whatever output format you need. When you need to
    modify that final output format, you can modify the XSL transformation
    document as needed.


    HTH


    Ralf


    Comment

    • Marcie Jones

      #3
      Re: Question on XSLT

      Hi RJN,
      I don't know it's overkill for your particular situation, but you could also take a look at BizTalk, which can do text to xml transformations as well
      as much more.

      Marcie

      On Tue, 17 May 2005 08:01:49 -0700, RJN <rjn@yahoo.co m> wrote:
      [color=blue]
      >
      >Hi
      >
      >Pardon me for posting an XML question here.
      >Can XSLT be applied for transforming .txt files or are they applicable
      >only for xml to xml transformation.
      >
      >Currently all the clients send file to a server in one particular
      >format. The format of the file which the server accepts is going to
      >change. So we need to build an intermediate system which will do the
      >transformati on from the old format to the new format. Can I use XSLT for
      >doing this? Is XSLT applicable only when xml to xml transformation is
      >involved?
      >
      >Regards
      >
      >rjn
      >
      >*** Sent via Developersdex http://www.developersdex.com ***[/color]

      Comment

      • Jay B. Harlow [MVP - Outlook]

        #4
        Re: Question on XSLT

        RJN,
        As _AnonCoward suggest, XSLT can only parse "XML", however in .NET it can
        parse anything that can be "represente d as" XML. In other words that has
        either an XPathNavigator for or can be read with an XmlReader object.

        For example the following article discusses ObjectXPathNavi gator that allows
        you to run XSLT against ANY object:
        http://msdn.microsoft.com/library/de...ml03172003.asp

        The following articles discuss how to create a custom XmlReader object:
        http://msdn.microsoft.com/msdnmag/is...l/default.aspx
        http://msdn.microsoft.com/msdnmag/is...4/05/XMLFiles/

        Depending on the format of the .txt file, I would probably create a custom
        XmlReader object similar to the GedcomReader in the last link above.

        Hope this helps
        Jay


        "RJN" <rjn@yahoo.co m> wrote in message
        news:eDiMbFvWFH A.1404@TK2MSFTN GP09.phx.gbl...
        |
        | Hi
        |
        | Pardon me for posting an XML question here.
        | Can XSLT be applied for transforming .txt files or are they applicable
        | only for xml to xml transformation.
        |
        | Currently all the clients send file to a server in one particular
        | format. The format of the file which the server accepts is going to
        | change. So we need to build an intermediate system which will do the
        | transformation from the old format to the new format. Can I use XSLT for
        | doing this? Is XSLT applicable only when xml to xml transformation is
        | involved?
        |
        | Regards
        |
        | rjn
        |
        | *** Sent via Developersdex http://www.developersdex.com ***


        Comment

        • Herfried K. Wagner [MVP]

          #5
          Re: Question on XSLT

          "RJN" <rjn@yahoo.co m> schrieb:[color=blue]
          > Can I use XSLT for
          > doing this? Is XSLT applicable only when xml to xml transformation is
          > involved?[/color]

          The output doesn't necessarily need to be in XML format.

          --
          M S Herfried K. Wagner
          M V P <URL:http://dotnet.mvps.org/>
          V B <URL:http://classicvb.org/petition/>

          Comment

          Working...