Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsXML Trans. output is being HTML encodedXML Trans. output is being HTML encoded
Previous
 
Next
New Post
11/7/2007 8:31 AM
 

I have tested my XSL in a browser - checked by adding the following line to the top fo the Show  XML output and saving it as a file

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="MYXSLFILE.xsl"?>

If I open xml it correctly transforms and works fine in the browser.

I have uploaded my xsl file to DNN and selected it as an XML Visulizer.

When I open the DNN page the values from the XML file are correctly inserted into the output but the HTML markup from the XSL file is visible - i.e. its encoded.

E.g.

<b><xsl:value-of select="Name"/></b> in XSL Outputs <b>SomeName</b> instead of SomeName

The first few lines of my xsl file are

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="1.0" indent="yes" omit-xml-declaration="yes"/>

 Any ideas?

 
New Post
11/8/2007 6:47 AM
 

Just to clarify - if I view the HTML SOURCE output

instead of seeing

<b> test </b>

You see

&lt;b&gt; test &lt;b&gt;t

So thats why the <b> is visible on page - its been encoded.

 
New Post
11/8/2007 5:00 PM
Accepted Answer 

Ryan, I can't reproduce your issue, however here some sample code:

SQL Query:

Select top 2 * from users

Returns

<?xml version="1.0" encoding="utf-8" ?>
<DocumentElement>
<QueryResults>
<UserID>1</UserID>
<Username>host</Username>
<FirstName>SuperUser</FirstName>
<LastName>Account</LastName>
<IsSuperUser>true</IsSuperUser>
<Email>host</Email>
<DisplayName>SuperUser Account</DisplayName>
<UpdatePassword>true</UpdatePassword>
</QueryResults>
<QueryResults>
<UserID>2</UserID>
<Username>admin</Username>
<FirstName>Administrator</FirstName>
<LastName>Account</LastName>
<IsSuperUser>false</IsSuperUser>
<Email>admin@localhost</Email>
<DisplayName>Administrator Account</DisplayName>
<UpdatePassword>true</UpdatePassword>
</QueryResults>
</DocumentElement>

Stylesheet:

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match ="DocumentElement/QueryResults">
<xsl:value-of select ="DisplayName"/>
<br/>
</xsl:template>
</xsl:stylesheet>

Renders to:

<?xml version="1.0" encoding="utf-8"?>
SuperUser Account<br />
Administrator Account<br />

Shown correctly as:

SuperUser Account
Administrator Account

 
New Post
11/13/2007 2:48 PM
 

Thanks Stefan - your example worked for me too so I took another look at this.

The problem was due to some encoded HTML in the xml source - an examle snippet of my XML

<DocumentElement><QueryResults>
<Testimonial>&lt;p&gt;I've started using your...&lt;/p&gt;</Testimonial>
</QueryResults></DocumentElement>

Now the interesting thing is that not only is the <p> etc output html encoded (as you would expect) but the rest of the valid html from the XSL stylesheet (NOT XML) is encoded too - which you wouldn't expect (and indeed it doesn't behave like this using other XML/XSL transform tools)

I therefore think that this is a bug - I will have a go at reporting this.

 

 

 

 
New Post
11/13/2007 2:55 PM
 

Now I know what to look for its in the issue db and has been corrected already for v5

http://support.dotnetnuke.com/issue/ViewIssue.aspx?p=0&id=6514

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsXML Trans. output is being HTML encodedXML Trans. output is being HTML encoded


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out