Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Tool to create XSLT templates

Reply
Thread Tools

Tool to create XSLT templates

 
 
Francesc001
Guest
Posts: n/a
 
      02-05-2008
I will try to explain a little which is the functionality that we are
looking for.

We need a tool to create XSL templates able to transform plane text to
XML.

As source we have strings where fields are concatenated one after
another. Fields are of different length.
We need to map these fields into defined schemas. This task implies to
split source data indicating position and length for each field.

I have downloaded the trial version of Altova Mapforce 2008 but
unfortunately the tool they have for split text files (called
FlexText) can not be used if generating XSLT, only is available to
generate JAVA, C# source code.

Do you know any software able to create this kind if XSL templates?

Thank you.

Francesc

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      02-05-2008
Francesc001 wrote:
> I will try to explain a little which is the functionality that we are
> looking for.
>
> We need a tool to create XSL templates able to transform plane text to
> XML.


But XSLT transforms a tree, usually created by parsing XML, to XML or
HTML or plain text. I don't see how you would apply templates to plain
text. You would need to write a parser first for your plain text format
to emit XML but then you would not need XSLT any longer.



--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
 
Francesc001
Guest
Posts: n/a
 
      02-06-2008
On 5 feb, 16:08, Martin Honnen <(E-Mail Removed)> wrote:

> But XSLT transforms a tree, usually created by parsing XML, to XML or
> HTML or plain text. I don't see how you would apply templates to plain
> text. You would need to write a parser first for your plain text format
> to emit XML but then you would not need XSLT any longer.


I will create an XML document with a simple tree, like this....

<MyXMLDoc>
<Parameter>1234</Parameter>
<Data>Here it is string to process</Data>
</MyXMLDoc>

I need a XSLT who take <Data> and split its fields to a new XML file.
I look for a tool for creating this XSLT.

Francesc

 
Reply With Quote
 
Pavel Lepin
Guest
Posts: n/a
 
      02-06-2008

Francesc001 <(E-Mail Removed)> wrote in
<(E-Mail Removed)>:
> On 5 feb, 16:08, Martin Honnen <(E-Mail Removed)> wrote:
>> But XSLT transforms a tree, usually created by parsing
>> XML, to XML or HTML or plain text. I don't see how you
>> would apply templates to plain text. You would need to
>> write a parser first for your plain text format to emit
>> XML but then you would not need XSLT any longer.

>
> I will create an XML document with a simple tree, like
> this....
>
> <MyXMLDoc>
> <Parameter>1234</Parameter>
> <Data>Here it is string to process</Data>
> </MyXMLDoc>
>
> I need a XSLT who take <Data> and split its fields to a
> new XML file. I look for a tool for creating this XSLT.


The tool you're looking for is commonly called "brain" and
humans are typically supplied with one at birth. If you
have lost or misplaced yours, contact your vendor's
customer support centre for a replacement.

On a more serious note, XSLT is not designed for string
processing. This might be bearable with XSLT2, but still a
curious design choice.

--
When all you have is a transformation engine, everything
looks like a tree.
 
Reply With Quote
 
Joseph Kesselman
Guest
Posts: n/a
 
      02-06-2008
Pavel Lepin wrote:
> On a more serious note, XSLT is not designed for string
> processing.


Slight disagreement: XSLT is not *optimized* for string processing. XSLT
and XPath do have string manipulation functions, and you can combine
those with XSLT recursion to achieve most desired results... but it may
be a bit painful. The XSLT FAQ website; it has a large number of
examples of how to do this.

But if you're looking for a tool to assist you in writing the stylesheet
to perform those string extractions... well, as Pavel suggested the most
common tool is a human who knows XSLT. There have been attempts to
create query-by-example tools that assist users in producing XSLT
transformations, but they're relatively uncommon and those which do
exist have generally focused on more the input document's structure than
on trying to break up the contents of individual fields.

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
 
Reply With Quote
 
Pavel Lepin
Guest
Posts: n/a
 
      02-06-2008

Joseph Kesselman <(E-Mail Removed)> wrote in
<47a9ca35@kcnews01>:
> Pavel Lepin wrote:
>> On a more serious note, XSLT is not designed for string
>> processing.

>
> Slight disagreement: XSLT is not *optimized* for string
> processing. XSLT and XPath do have string manipulation
> functions, and you can combine those with XSLT recursion
> to achieve most desired results...


Nitpick acknowledged, "optimised" is a better word under the
circumstances: XSLT1 was designed with limited
string-processing capabilities, but not intended to do
serious string processing, and not optimised for that task.

> but it may be a bit painful.


Slight disagreement: in XSLT1 it's often *quite* painful.
<smile pained="yes"/>

--
When all you have is a transformation engine, everything
looks like a tree.
 
Reply With Quote
 
Francesc001
Guest
Posts: n/a
 
      02-07-2008
OK. I think I will try the tool Pavel Lepin said. So, I am looking for
a brain able to......

Thanks!

Francesc
 
Reply With Quote
 
dnovatchev@gmail.com
Guest
Posts: n/a
 
      03-02-2008
> On a more serious note, XSLT is not designed for string
> processing. This might be bearable with XSLT2, but still a
> curious design choice.



Not quite true. XSLT 2 and XPath F & O provide powerful text-
processing functions, including RegEx processing.

I have had some nice experience implementing a generalized LR(1)
parser in XSLT, a JSON to XML convertor (the f:json-document()
function of FXSL), an XPath 2.0 parser, a spell checker, a concordance
tool, a text justification tool -- all with reasonable efficiency (for
example the spellchecker processes several thousand words per second).


Cheers,
Dimitre Novatchev



On Feb 6, 1:43*am, Pavel Lepin <(E-Mail Removed)> wrote:
> Francesc001 <(E-Mail Removed)> wrote in
> <(E-Mail Removed)>:
>
>
>
>
>
> > On 5 feb, 16:08, Martin Honnen <(E-Mail Removed)> wrote:
> >> ButXSLTtransforms a tree, usually created by parsing
> >> XML, to XML or HTML or plain text. I don't see how you
> >> would applytemplatesto plain text. You would need to
> >> write a parser first for your plain text format to emit
> >> XML but then you would not needXSLTany longer.

>
> > I willcreatean XML document with a simple tree, like
> > this....

>
> > <MyXMLDoc>
> > * * <Parameter>1234</Parameter>
> > * * <Data>Here it is string to process</Data>
> > </MyXMLDoc>

>
> > I need aXSLTwho take <Data> and split its fields to a
> > new XML file. I look for atoolfor creating thisXSLT.

>
> Thetoolyou're looking for is commonly called "brain" and
> humans are typically supplied with one at birth. If you
> have lost or misplaced yours, contact your vendor's
> customer support centre for a replacement.
>
> On a more serious note,XSLTis not designed for string
> processing. This might be bearable with XSLT2, but still a
> curious design choice.
>
> --
> When all you have is a transformation engine, everything
> looks like a tree.- Hide quoted text -
>
> - Show quoted text -


 
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
how to Specializations of function Templates or Overloading Function templates with Templates ? recover C++ 2 07-25-2006 02:55 AM
Monster Templates - Question about Submitting Templates Fred HTML 1 09-26-2005 01:09 AM
[XSLT:FO] Create templates from business forms =?iso-8859-1?Q?Marcel_St=F6r?= XML 0 09-06-2004 07:51 AM
Templates templates templates JKop C++ 3 07-21-2004 11:44 AM
using templates in templates John Harrison C++ 8 07-31-2003 12:00 PM



Advertisments