Click here to Skip to main content
16,004,890 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: XML round trip problems Pin
Christian Graus20-Oct-03 15:17
protectorChristian Graus20-Oct-03 15:17 
GeneralRe: XML round trip problems Pin
james-cxx20-Oct-03 17:33
james-cxx20-Oct-03 17:33 
GeneralRe: XML round trip problems Pin
Christian Graus21-Oct-03 9:34
protectorChristian Graus21-Oct-03 9:34 
QuestionHow to save the content of Datagrid into XML file and retrieve the content into Datagrid? Pin
Cybermilky17-Oct-03 20:46
Cybermilky17-Oct-03 20:46 
GeneralReally interesting problem ! Pin
pahluwalia17-Oct-03 11:52
pahluwalia17-Oct-03 11:52 
GeneralDataSet from XML Schema Pin
pahluwalia17-Oct-03 9:34
pahluwalia17-Oct-03 9:34 
GeneralXML Complex Type, DataSet Pin
pahluwalia17-Oct-03 6:36
pahluwalia17-Oct-03 6:36 
GeneralXML Transformation Trouble... Pin
CreProDes17-Oct-03 1:04
CreProDes17-Oct-03 1:04 
Hi all,
Currently I am working on a template solution which transforms contents of a given section (which is in a xml format) with the help of preset XLST files assigned to those sections. The code goes something like this

/Default.aspx
<code>
.
.
.
.
// Get the sections data in XML format
string xmlData = DataLoader.GetSectionData(sectionName, sectionPath, articleId, pageNumber );

// Get that sections template file
string xslFile = Server.MapPath("/")+"Files\\Templates\\"+ templateFile +"\\Default.xsl";

System.IO.StringReader sr = new System.IO.StringReader(xmlData);

XPathDocument doc = new XPathDocument(sr);

XslTransform trans = new XslTransform();

trans.Load(xslFile);

//Transform it and output as HTML
XmlTextWriter writer = new XmlTextWriter(Response.Output);

writer.Formatting = Formatting.None;

trans.Transform(doc,null,writer);



/SectionData.xml
<Root>
<Article>
<Title>Wonders of life</Title>
<Content>
<!--
<u>Sometimes<u>, you wonder how a particular thing went wrong; < b>but most of the time</ b> you wonder how it worked at all
-->
</Content>
</Article></Root>


/SectionTemplate.xslt
.
.
.
<xsl:value-of select="/Root/Article/Title" />
<br />
<xsl:value-of select="/Root/Article/Content/comment()" disable-output-escaping="yes" />
.
.
.



What i expected of the tranformer was to spit the contents of the comment tag to the browser without any parsing/escaping so the html formatting of the given article can be maintained, but whatever is done (I even tried with copy-of xsl element to no effect) the output I get is like this in the article page (HTML VIEW of the generated code)

Wonders of life<br />
&lt;u&gt;Sometimes&lt;u&gt;, you wonder how a particular thing went wrong; &lt;b&gt;but most of the time&lt;/b&gt; you wonder how it worked at all


I understand that we can accomplish this by embedding the html code inside CDATA section but that too didnt work out well. Any alternate suggestions are also welcome.

Thanking you

CreProDes

CreProDes
GeneralRe: XML Transformation Trouble... Pin
Philip Fitzsimons17-Oct-03 3:04
Philip Fitzsimons17-Oct-03 3:04 
GeneralRe: XML Transformation Trouble... Pin
CreProDes17-Oct-03 3:56
CreProDes17-Oct-03 3:56 
GeneralLookup Table (sort of) in XML Pin
Asad Hussain16-Oct-03 8:51
Asad Hussain16-Oct-03 8:51 
GeneralRe: Lookup Table (sort of) in XML Pin
Asad Hussain16-Oct-03 11:36
Asad Hussain16-Oct-03 11:36 
GeneralSystem.Xml Pin
Michael P Butler15-Oct-03 10:42
Michael P Butler15-Oct-03 10:42 
GeneralRe: System.Xml Pin
Nick Parker15-Oct-03 15:54
protectorNick Parker15-Oct-03 15:54 
QuestionWhat's the best XML format? Pin
Alvaro Mendez14-Oct-03 8:20
Alvaro Mendez14-Oct-03 8:20 
AnswerRe: What's the best XML format? Pin
Stuart Dootson14-Oct-03 9:22
professionalStuart Dootson14-Oct-03 9:22 
GeneralRe: What's the best XML format? Pin
Alvaro Mendez14-Oct-03 9:47
Alvaro Mendez14-Oct-03 9:47 
GeneralRe: What's the best XML format? Pin
Stuart Dootson14-Oct-03 11:34
professionalStuart Dootson14-Oct-03 11:34 
GeneralRe: What's the best XML format? Pin
CreProDes17-Oct-03 1:00
CreProDes17-Oct-03 1:00 
AnswerRe: What's the best XML format? Pin
Philip Fitzsimons17-Oct-03 3:09
Philip Fitzsimons17-Oct-03 3:09 
QuestionHow to Determine if element contains a given attribute Pin
MStanbrook13-Oct-03 9:31
MStanbrook13-Oct-03 9:31 
AnswerRe: How to Determine if element contains a given attribute Pin
Jeromy Stites13-Oct-03 11:41
Jeromy Stites13-Oct-03 11:41 
AnswerRe: How to Determine if element contains a given attribute Pin
Tim McCurdy23-Oct-03 14:24
Tim McCurdy23-Oct-03 14:24 
GeneralRe: How to Determine if element contains a given attribute Pin
MStanbrook23-Oct-03 15:03
MStanbrook23-Oct-03 15:03 
QuestionHow to create xml document from dataset with null values ? Pin
susree13-Oct-03 5:06
susree13-Oct-03 5:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.