472,805 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 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 1280

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Justine Hlista | last post by:
I'm using xalan-j_2_6_0 and trying to get an example from Michael Kay's book to work: <xsl:template match="/"> <xsl:variable name="rainbow"> <color>red</color> <color>blue</color>...
3
by: Phil | last post by:
Hi everybody, I am a XSLT beginner and the following problem really makes me crazy ! I have a main "contacts.xml" document which contains references to several contact data XML files. My aim...
9
by: Weekend | last post by:
Currently, i want to develope a multiple choice exam website. The content of the test is store in an XML file. I want to carry out some function. Could you tell me which programming language should...
1
by: mountain1228 | last post by:
Hello, I apoligize in advance if this post is off-topic in this group. I have been converting xml to html with an xslt stylesheet using the program xslt-parser that comes with RH 7.3. The...
5
by: dennis | last post by:
Hi, First of all, hi to you all. I'm working on a Delphi project wich is becoming near it's deadline. I have a very simple XSLT question wich i hope one of you folks can help me with? The...
18
by: yinglcs | last post by:
Hi, I have a newbie XSLT question. I have the following xml, and I would like to find out the children of feature element in each 'features' element. i.e. for each <featuresI would like to...
2
by: 张韡武 | last post by:
We have preffered language set as variable in xslt: <xsl:variable name="preferred_language"> zh </xsl:variable> Data: <name xml:lang="de">Raw Materials (Mining incl.)</name> <name...
14
by: Lee | last post by:
I have a xml file, here is sample part: <?xml version="1.0" encoding="UTF-8"?> <ProducsList> <Product id="1"> <SpecList> <Spec> <SpecLabel>Height</SpecLabel> <SpecValue>10</SpecValue>...
2
by: astroboiii | last post by:
New to the whole xml thing and finding w3schools to be an excellent resource. Now down to my question: I have several xml files I need to parse through and grab relevant information from and...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.