Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I've been discussing an idea of mine for a generalized Transformation API on the Module Author's list and wondered what the Monks might have to say about it.

The idea is this: I would like to have a semi-intelligent way of translating files from one format to another. I would like this system to be able to, at least partially, detect some aspects of the source and intermediate format of the file to determine how to reach the eventual destination format. I envision the ability to (eventually) translate one or more source files (or file handles) into one or more sink files (or file handles).

Example 1: Two-step Image Conversion

That's vague, so let me describe a couple examples (use-cases for you Software Engineers). First, let's say I want to convert a TGA file into a PDF. I have a converter that will translate the TGA into a PS file and a converter from PS to PDF. The user supplies the TGA file and says, "Make it a PDF." The system the finds a path from TGA to PDF using the available converters, runs the transformations, and returns the result.

Example 2: Three-Step Document Conversion

Second, let's say I have an XML file in DocBook format that includes some other markup in custom namespaces for some specialized information. It also includes some TAL information (just read the latest TPJ) that needs to generate some info. I want it to be converted to HTML. So, the system looks at the configuration and determines that I am converting an XML file that contains the TAL and other custom namespaces. I have an XSL stylesheet that can translate the specialized markup into pure DocBook, the TAL can be evaluated using Petal, I can use the DocBook XSL stylesheets to generate HTML.

The system should see a path like this:

  1. Use Petal to eliminate the TAL from the document.
  2. Use the XSL stylesheet to translate the custom markup into DocBook; we should now have a pure DocBook file.
  3. Use the DocBook transformation to translate the file into HTML.

Questions...

So, does such an API sound interesting? Why? Why not? What caveats would you anticipate? I've thought of several, but I want to make sure I know the risks. Anyone have a suggestion for an API or utility that is similar in Perl or another language? (That is, metaconversion tools, not actual converters like XSLT or ImageMagick.)

I honorably request the wisdom of the Monks. Thank you for your thoughts.


In reply to General Transformation API by hanenkamp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-26 03:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found