Tool to create XSLT templates

Francesc001

Usenet Archive
Joined
Feb 5, 2008
Messages
3
Reaction score
0
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
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
Francesc001 said:
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.
 

Francesc001

Usenet Archive
Joined
Feb 5, 2008
Messages
3
Reaction score
0
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
 

Pavel Lepin

Usenet Archive
Joined
Apr 20, 2007
Messages
263
Reaction score
0
Francesc001 said:
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.
 

Joseph Kesselman

Usenet Archive
Joined
Feb 3, 2006
Messages
733
Reaction score
0
Pavel said:
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.
 

Pavel Lepin

Usenet Archive
Joined
Apr 20, 2007
Messages
263
Reaction score
0
Joseph Kesselman said:
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"/>
 

Francesc001

Usenet Archive
Joined
Feb 5, 2008
Messages
3
Reaction score
0
OK. I think I will try the tool Pavel Lepin said. So, I am looking for a brain able to......

Thanks!

Francesc
 

dnovatchev

Usenet Archive
Joined
Dec 15, 2007
Messages
7
Reaction score
0
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,049
Messages
3,104,245
Members
248,133
Latest member
DujonT

Latest Threads

Top