Tool to create XSLT templates

Discussion in 'XML' started by Francesc001, Feb 5, 2008.

  1. Francesc001

    Francesc001 Guest

    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
     
    Francesc001, Feb 5, 2008
    #1
    1. Advertising

  2. 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/
     
    Martin Honnen, Feb 5, 2008
    #2
    1. Advertising

  3. Francesc001

    Francesc001 Guest

    On 5 feb, 16:08, Martin Honnen <> 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
     
    Francesc001, Feb 6, 2008
    #3
  4. Francesc001

    Pavel Lepin Guest

    Francesc001 <> wrote in
    <>:
    > On 5 feb, 16:08, Martin Honnen <> 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.
     
    Pavel Lepin, Feb 6, 2008
    #4
  5. 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
     
    Joseph Kesselman, Feb 6, 2008
    #5
  6. Francesc001

    Pavel Lepin Guest

    Joseph Kesselman <> 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.
     
    Pavel Lepin, Feb 6, 2008
    #6
  7. Francesc001

    Francesc001 Guest

    OK. I think I will try the tool Pavel Lepin said. So, I am looking for
    a brain able to......

    Thanks!

    Francesc
     
    Francesc001, Feb 7, 2008
    #7
  8. Francesc001

    Guest

    > 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 <> wrote:
    > Francesc001 <> wrote in
    > <>:
    >
    >
    >
    >
    >
    > > On 5 feb, 16:08, Martin Honnen <> 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 -
     
    , Mar 2, 2008
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fred
    Replies:
    1
    Views:
    635
    Neredbojias
    Sep 26, 2005
  2. =?iso-8859-1?Q?Marcel_St=F6r?=

    [XSLT:FO] Create templates from business forms

    =?iso-8859-1?Q?Marcel_St=F6r?=, Sep 6, 2004, in forum: XML
    Replies:
    0
    Views:
    469
    =?iso-8859-1?Q?Marcel_St=F6r?=
    Sep 6, 2004
  3. John Harrison

    using templates in templates

    John Harrison, Jul 31, 2003, in forum: C++
    Replies:
    8
    Views:
    403
    Torsten Curdt
    Jul 31, 2003
  4. JKop
    Replies:
    3
    Views:
    520
  5. recover
    Replies:
    2
    Views:
    856
    recover
    Jul 25, 2006
Loading...

Share This Page