Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Converting XML to XSLT

Reply
Thread Tools

Converting XML to XSLT

 
 
Vince
Guest
Posts: n/a
 
      02-18-2008
Hi,

I've done a few searches and I can't seem to find a tool that will
translate XML into an XSLT document.

Is the only way to do it really by hand?

I have a large file and a tool would really speed things up. Any
suggestions?

Thank you.
 
Reply With Quote
 
 
 
 
Pavel Lepin
Guest
Posts: n/a
 
      02-18-2008

Vince <(E-Mail Removed)> wrote in
<(E-Mail Removed)>:
> I've done a few searches and I can't seem to find a tool
> that will translate XML into an XSLT document.


You're seriously confused. XSLT is a programming language
for expressing XML document transformations. I don't see
what you could possibly mean by "will translate XML into an
XSLT document".

--
When all you have is a transformation engine, everything
looks like a tree.
 
Reply With Quote
 
 
 
 
Vince
Guest
Posts: n/a
 
      02-18-2008
On Feb 18, 6:15 pm, Pavel Lepin <(E-Mail Removed)> wrote:
> Vince <(E-Mail Removed)> wrote in
> <(E-Mail Removed)>:
>
> > I've done a few searches and I can't seem to find a tool
> > that will translate XML into an XSLT document.

>
> You're seriously confused. XSLT is a programming language
> for expressing XML document transformations. I don't see
> what you could possibly mean by "will translate XML into an
> XSLT document".
>
> --
> When all you have is a transformation engine, everything
> looks like a tree.


Programming language my as*

Your right, it transforms XML by replacing non static data. Whats so
hard to understand about conversion?
 
Reply With Quote
 
Richard Tobin
Guest
Posts: n/a
 
      02-18-2008
In article <(E-Mail Removed)>,
Vince <(E-Mail Removed)> wrote:
>Your right, it transforms XML by replacing non static data. Whats so
>hard to understand about conversion?


Like Pavel, I have no idea what you're talking about. "Converting XML to
XSLT" is like "converting ASCII to Fortran".

Perhaps you could give us an example of what you want to do?

-- Richard
--
:wq
 
Reply With Quote
 
Stanimir Stamenkov
Guest
Posts: n/a
 
      02-19-2008
Sun, 17 Feb 2008 21:58:49 -0800 (PST), /Vince/:

> I've done a few searches and I can't seem to find a tool that will
> translate XML into an XSLT document.
>
> Is the only way to do it really by hand?
>
> I have a large file and a tool would really speed things up. Any
> suggestions?


You can do it by using another XSLT document containing the
necessary transformation instructions, then run it through an XSLT
processor and feed it with your XML data.

--
Stanimir
 
Reply With Quote
 
Andy Dingley
Guest
Posts: n/a
 
      02-19-2008
On 18 Feb, 05:58, Vince <(E-Mail Removed)> wrote:

> I've done a few searches and I can't seem to find a tool that will
> translate XML into an XSLT document.


There are two ways to do this.

One is dead easy. So easy that we do it by hand, because it's not
worth writing a tool to do it for us. Just take the minimal XSLT
stylesheet that matches "/" and then paste your target XML document
inside the template element. You now have a valid XSLT stylesheet that
matches anything you feed it and generates your target XML document.
It's not agreat deal of use, but if what you want is something like
an existing XHTML example, then it can be a useful starting point to
save re-typing everything.

The second way carefully maps recognisable structures in the XML input
document to some abstract application-specific meta-structure, then to
map this meta-structure in turn onto the associated output content
units, with their necessary content. This is so fundamentally
difficult that it's an AI research project to do automatically, not
just some little downloadable script.
 
Reply With Quote
 
McSwell
Guest
Posts: n/a
 
      02-20-2008
On Feb 18, 5:09 pm, Vince <(E-Mail Removed)> wrote:
> Your right, it transforms XML by replacing non static data. Whats so
> hard to understand about conversion?


What's so hard to understand is what it is you're trying to convert to
what. XSLT transforms already are XML, as stated in http://www.w3.org/TR/xslt:

"A transformation in the XSLT language is expressed as a well-formed
XML document..."

So there is no such thing as you asked for: "translate XML into an
XSLT document." You can however use XSLT code to translate an XML
document into some other format, whether it be another XML format (or
even an identical XML format), tab-delimited fields, or whatever.

Mike Maxwell
CASL/ U MD
 
Reply With Quote
 
Joseph Kesselman
Guest
Posts: n/a
 
      02-20-2008
Since we have a terminology problem, it might help to give a specific
(small!) example. What kind of XML are you starting with, and what do
you want the "conversion" to produce?

If you're trying to produce a stylesheet which will render that XML
document type for viewing by users... Yes, that has to be done by a
human, because someone has to decide what the rendered representation of
the document should be. It may be as simple as the XML source, or a tree
view thereof, or it may be a complex re-arrangement involving
selection/rejection of interesting portions, construction of indexes,
computations upon the data, etc. If you don't feel like dealing with
that, you might want to start with one of the XML-based languages like
Docbook which already has stylesheets written to render it.

If you're trying to produce a stylesheet that will do simple
impedence-matching from one XML structure to another... There have been
attempts to create "query by example" frameworks which let you
hand-construct the output you want for a given input and will then help
you match the two up against each other. The problem with this approach
is that it involves a certain amount of guesswork/mindreading on the
program's part, and/or human involvement to help clarify the intent, so
it isn't really clear that this is a lot easier than constructing the
stylesheet by hand. In some domains this approach works well, but the
fact that we don't hear much about it is some indication of how limited
those domains are.

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem to insert an XML-element by XSLT-converting from one XML-file into another XML-file jkflens XML 2 05-30-2006 09:41 AM
Including XSLT/XML document within a XSLT document dar_imiro@hotmail.com XML 4 12-13-2005 02:26 AM
ANN: New low-cost XML Editor, XSLT Editor, XSLT Debugger, DTD/Schema Editor Stylus Studio Java 0 08-03-2004 03:53 PM
Problem converting XML with XSLT to another XML H. Kaya XML 1 02-13-2004 10:16 AM
Problem converting XML to HTML using XSLT on Netscape 7.0 nanookfan XML 2 01-14-2004 11:09 AM



Advertisments