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 768265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:09:19+00:00 2026-05-14T18:09:19+00:00

Is it possible to use XSLT to transform XML into something other than XML?

  • 0

Is it possible to use XSLT to transform XML into something other than XML?

e.g. i want the final non-xml content:

<Content>
   <image url="file1.png">
   <image url="file2.png">
   ...
   <image url="filen.png">
<EndContent>

You’ll notice this document is not xml (or even html), but it does have what we would call <elements>.

Is it possible, using XSLT, to generate non-xml output?


Another example of non-xml output might be:

<HTML>
<BODY>
   <IMG src="file1.png"><BR>
   <IMG src="file2.png"><BR>
   ...
   <IMG src="filen.png"><BR>
</BODY>
</HTML>

You’ll notice this document is HTML, because in HTML IMG and BR tags are forbidden from having a closing tag. This contrasts with xhtml (the reformulation of HTML using xml) where all elements are required to have a closing tag (because in xml every tag must be closed).


Another example of non-xml output might be:

INSERT INTO Documents (Filename) VALUES ('file1.png')
INSERT INTO Documents (Filename) VALUES ('file2.png')
...
INSERT INTO Documents (Filename) VALUES ('file3.png')

i can make up any source xml i like, but one example might be:

Source xml:

<DocumentStore>
   <Document type="image">file1.png</Document>
   <Document type="image">file2.png</Document>
   <Document type="image">filen.png</Document>
</DocumentStore>    

Or perhaps:

<Profiles>
   <User avatar="file1.png" />
   <User avatar="file2.png" />
   <User avatar="filen.png" />
</Profiles>
  • 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-05-14T18:09:20+00:00Added an answer on May 14, 2026 at 6:09 pm

    You can use <xsl:output> to specify the output format, which doesn’t have to be xml, see this reference page.

    However, if you are outputting html, no modern browser should complain even if you do put the closing tags, so using your example above, i believe all browser should be ok with :-

    <HTML>
    <BODY>
       <IMG src="file1.png"></IMG><BR></BR>
       <IMG src="file2.png"></IMG><BR></BR>
       ...
       <IMG src="filen.png"></IMG><BR></BR>
    </BODY>
    </HTML>
    

    So not too sure why you don’t want to put the closing tag, unless i’m missing something.


    Update: Added example of non xml output

    Given this stylesheet:-

    <?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" />
        <xsl:template match="/filenames">
    
        <xsl:for-each select="filename">
        INSERT INTO Documents (Filename) VALUES ('<xsl:value-of select="." />')
        </xsl:for-each>
    
        </xsl:template>
    </xsl:stylesheet>
    

    and this input xml:-

    <?xml version="1.0" encoding="UTF-8"?>
    <filenames>
        <filename>file1.png</filename>
        <filename>file2.png</filename>
        <filename>file3.png</filename>
    </filenames>
    

    You get output like this:-

    INSERT INTO Documents (Filename) VALUES ('file1.png')
    
    INSERT INTO Documents (Filename) VALUES ('file2.png')
    
    INSERT INTO Documents (Filename) VALUES ('file3.png')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.