Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8662523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:45:16+00:00 2026-06-12T16:45:16+00:00

I am starting to work on a project where I receive data in XML,

  • 0

I am starting to work on a project where I receive data in XML, which has to be translated into a text file that represents python to be executed.

I came across this:

XML To Text

and wonder what XSLT experts think about it. Any feedback would be very much appreciated. Many thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:45:17+00:00Added an answer on June 12, 2026 at 4:45 pm

    Producing a python script via XSLT is entirely possible.

    text is one of the choices for the method (i.e. format) in xsl:output

    You use it in your stylesheet like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:output method="text" encoding="UTF-8" indent="yes"/>   
    
       <xsl:template match="/">
           <xsl:text>#!/usr/bin/env python&#xA;</xsl:text>
           <xsl:text># This program is a "Hello World" example&#xA;</xsl:text>
           <xsl:text>print 'Hello world!'</xsl:text>
       </xsl:template> 
    </xsl:stylesheet>
    

    The above stylesheet produces the following Python script

    #!/usr/bin/env python
    # This program is a "Hello World" example
    print 'Hello world!'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am starting work on a project which has multiple websites for a client.
I'm starting to work on a project that will require a lot of image
I'm starting a new project in plain C (c99) that is going to work
I'm starting work on java project. The application has no GUI and does not
I am starting to work on a hobby project with a Python codebase and
I'm starting some work on a rather large JS project and want to make
We are starting a rather complex new project at work, and need some sort
I'm starting a new project and setting up the base to work on. A
I'm starting to work on a small script that takes a string, counts the
I'm starting to work with oop to build a site of user generated data.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.