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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:32:42+00:00 2026-05-25T03:32:42+00:00

i am trying to create a transformation which output will be text but including

  • 0

i am trying to create a transformation which output will be text but including original xml as well. Simply i got the xml message that should be transformed to SQL insert but in case of an SQL error i want to insert the original xml message to database as well.

The input is e.g.:

<message><tag name="foo">dummy</tag></message>

The result of the transformation should be then:

INSERT INTO table (column) VALUES ('dummy')
IF @@error <> 0
BEGIN
   INSERT INTO errMsgLog (message) VALUES ('<message><tag name="foo">dummy</tag></message>')
END

The problem is if i set the output in XSLT to ‘text’ there are no xml tags included (just the values). So is there any mixed output mode or attribute override?

Thanks for any help.

  • 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-25T03:32:42+00:00Added an answer on May 25, 2026 at 3:32 am

    Before approaching this solution (don’t know if through XSLT you can find some better solution), also consider the problems you will encounter with much more complex input and output.

    Even if purists will reject this answer (and the question also), you can use “xml” output method to do a (very ugly) trickery:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:output omit-xml-declaration="yes"/>    
        <xsl:strip-space elements="*"/>
    
        <xsl:template match="/">
            <xsl:text disable-output-escaping="yes">INSERT INTO table (column) VALUES ('dummy')
    IF @@error &lt;> 0
    BEGIN
         INSERT INTO errMsgLog (message) VALUES ('</xsl:text>
            <xsl:copy-of select="."/><xsl:text>')
    END</xsl:text>
        </xsl:template>
    
    </xsl:stylesheet>
    

    outputs:

    INSERT INTO table (column) VALUES ('dummy')
    IF @@error <> 0
    BEGIN
         INSERT INTO errMsgLog (message) VALUES ('<message><tag name="foo">dummy</tag></message>')
    END
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am basically trying to create a display object transformation manager which will allow
I'm trying to write an XSLT transformation which will replace the value in one
I'm trying to create an expandable menu item in android, which will look like
I am trying create an application which will clone the GIT repository to the
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Trying to create a user account in a test. But getting a Object reference
I am trying to create a scene graph for my 3D game in which
I am trying to write a stored procedure in MySQL which will perform a
I am doing some work with T4 (Text Template Transformation Toolkit) and am trying
I'm trying create an immutable object and initialise it from xml config file in

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.