471,319 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

Question on XSLT

RJN

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 ***
Nov 21 '05 #1
4 1137

"RJN" <rj*@yahoo.com> wrote in message
news:eD**************@TK2MSFTNGP09.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
Nov 21 '05 #2
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 <rj*@yahoo.com> wrote:

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 ***


Nov 21 '05 #3
RJN,
As _AnonCoward suggest, XSLT can only parse "XML", however in .NET it can
parse anything that can be "represented 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 ObjectXPathNavigator 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" <rj*@yahoo.com> wrote in message
news:eD**************@TK2MSFTNGP09.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 ***
Nov 21 '05 #4
"RJN" <rj*@yahoo.com> schrieb:
Can I use XSLT for
doing this? Is XSLT applicable only when xml to xml transformation is
involved?


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/>
Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Justine Hlista | last post: by
1 post views Thread by mountain1228 | last post: by
2 posts views Thread by astroboiii | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.