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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:11:13+00:00 2026-06-09T12:11:13+00:00

I have the following XML: <?xml version=1.0 encoding=utf-8?> <string> &lt;Table&gt; &lt;Rows&gt; &lt;Row Id=0&gt; &lt;Column

  • 0

I have the following XML:

<?xml version="1.0" encoding="utf-8"?>
<string>
&lt;Table&gt;
&lt;Rows&gt;
&lt;Row Id="0"&gt;
&lt;Column Name="INS_NAME" XPath="Ins.Name"&gt;Jane&lt;/Column&gt;
&lt;Column Name="INS_LASTNAME" XPath="Ins.LastName"&gt;Smith&lt;/Column&gt;
&lt;/Row&gt;
&lt;Row Id="1"&gt;
&lt;Column Name="INS_NAME" XPath="Ins.Name"&gt;Joe&lt;/Column&gt;
&lt;Column Name="INS_LASTNAME" XPath="Ins.LastName"&gt;Miller&lt;/Column&gt;
&lt;/Row&gt;
&lt;Row Id="2"&gt;
&lt;Column Name="INS_NAME" XPath="Ins.Name"&gt;George&lt;/Column&gt;
&lt;Column Name="INS_LASTNAME" XPath="Ins.LastName"&gt;Ramsey&lt;/Column&gt;
&lt;/Row&gt;
&lt;/Rows&gt;
&lt;/Table&gt;
</string>

and I would like to transform it to this XML using a single XSLT:

<?xml version="1.0" encoding="utf-8"?>
<Customers>
  <Customer><Name>Jane</Name><LastName>Smith</LastName></Customer>
  <Customer><Name>Joe</Name><LastName>Miller</LastName></Customer>
  <Customer><Name>George</Name><LastName>Ramsey</LastName></Customer>
</Customers>

I can do it with two different XSLT’s:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <xsl:value-of select="/" disable-output-escaping="yes" />
  </xsl:template>
</xsl:stylesheet>

and then:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <Customers>
      <xsl:for-each select="Table/Rows/Row">
      <Customer>
        <Name><xsl:value-of select="Column[@Name='INS_NAME']" /></Name>
        <LastName><xsl:value-of select="Column[@Name='INS_LASTNAME']" /></LastName>
      </Customer>
      </xsl:for-each>
    </Customers>
  </xsl:template>
</xsl:stylesheet>

I have been reading about multi phase transformations but I can’t seem to get it. I have tried saving the first XSLT in a variable but it seems disable-output-escaping="yes" does not work when saving to a variable.

Can anybody help?

Thank you.

New information (Edit)

I am now translating the string this way:

<xsl:output method="text"/>
  <xsl:template match="/">
    <xsl:variable name="stringXml">
      &lt;?xml version="1.0" encoding="utf-8"?&gt;
      <xsl:value-of select="translate(translate(/,'&gt;','&gt;'),'&lt;','&lt;')" />
    </xsl:variable>
...

How can I do a transformation on the resulting XML stored in stringXML?

Final Solution (Edit)

<msxml:script implements-prefix="myLib" language="C#">
<msxml:assembly name="System.Web"/>
<msxml:using namespace="System.Web"/>
<![CDATA[
public System.Xml.XPath.XPathNodeIterator convertText(string text)
{
XmlDocument doc = new XmlDocument();
      doc.PreserveWhitespace = true;
      doc.LoadXml(text);
      return doc.CreateNavigator().Select("/");
}
]]>
</msxml:script>
  • 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-09T12:11:15+00:00Added an answer on June 9, 2026 at 12:11 pm

    it seems disable-output-escaping=”yes” does not work when saving to a
    variable.

    Your observation is correct.

    DOE only affects the serialization of the (final) result of the transformation and isn’t applied on intermediary trees.

    Here is what the W3C XSLT 1.0 specification explicitly says:

    “An XSLT processor will only be able to disable output escaping if it
    controls how the result tree is output. This may not always be the
    case. For example, the result tree may be used as the source tree for
    another XSLT transformation instead of being output.”

    The same negative answer holds for trying to use a variable, whose value is a string, containing a textual representation of an XML document.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example, say I have the following xml in a string: <?xml version=1.0 encoding=UTF-8?>
I have the following XML file: <?xml version=1.0 encoding=utf-8 ?> <strategies> <strategy name=God Class>
I have the following XML structure: <?xml version=1.0 encoding=utf-8?> <xml> <root> <Item> <taxids> <string>330</string>
I have the following XML: <?xml version=1.0 encoding=UTF-8?> <game> <name>Space Blaster</name> <description></description> <version>1</version> <fullscreen>false</fullscreen>
I have the following XML Document: <?xml version=\1.0\ encoding=\UTF-8\?> <atom:entry xmlns:atom=\http://www.w3.org/2005/Atom\ xmlns:apps=\http://schemas.google.com/apps/2006\ xmlns:gd=\http://schemas.google.com/g/2005\> <apps:property
I have the following simplified XML: <?xml version="1.0" encoding="UTF-8" ?> <MATMAS05> <IDOC BEGIN="1"> <E1MARAM
I have the following simplified XML structure: <?xml version="1.0" encoding="UTF-8" ?> <INVOIC02> <IDOC BEGIN="1">
Say I have this following XML structure: <?xml version=1.0 encoding=UTF-8?> <main> <parent> <child1>some value</child1>
I have the following XML snippet: <?xml version=1.0 encoding=utf-8?> <dmFiles> <dmFile dmUpFileGuid= dmFileDescr=testcase01.pdf dmFileMetaType=main
I have the following xml file: <?xml version=1.0 encoding=utf-8?> <root> <phrase id=test><![CDATA[test]]></phrase> <phrase id=test0><![CDATA[test0]]></phrase>

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.