Click here to Skip to main content
15,918,976 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Expand and Collapse Detail Editing Pin
Brady Kelly6-Nov-07 23:00
Brady Kelly6-Nov-07 23:00 
QuestionPassing Querystring in param tag value Pin
Pankaj Chamria6-Nov-07 21:44
Pankaj Chamria6-Nov-07 21:44 
Questionhow to create session in asp.net web application Pin
manish.singhal6-Nov-07 21:44
manish.singhal6-Nov-07 21:44 
AnswerRe: how to create session in asp.net web application [modified] Pin
Sun Rays6-Nov-07 22:09
Sun Rays6-Nov-07 22:09 
GeneralRe: how to create session in asp.net web application Pin
Imran Khan Pathan6-Nov-07 22:18
Imran Khan Pathan6-Nov-07 22:18 
AnswerRe: how to create session in asp.net web application Pin
Piyush Vardhan Singh6-Nov-07 22:09
Piyush Vardhan Singh6-Nov-07 22:09 
GeneralRe: how to create session in asp.net web application Pin
manish.singhal11-Nov-07 20:05
manish.singhal11-Nov-07 20:05 
Questionxml tranformation using asp.net Pin
gottimukkala6-Nov-07 21:16
gottimukkala6-Nov-07 21:16 
Hi,

I am trying to transform an xml file to wml using asp.net. I get the xml file from sql server as a string. so I need to convert it to xml and tranform that xml file to wml.

Here is my code:

private void XmlTransformToWML(string hn_xml)
{
XmlDocument xmlDoc = new XmlDocument();

try
{
xmlDoc.LoadXml(hn_xml);
}
catch (XmlException e)
{
Response.Write(e.Message);
}
XPathDocument xpathDoc = new XPathDocument();

string xslPath = Server.MapPath("hnxml.xslt");


XslCompiledTransform myXslTrans = new XslCompiledTransform();
//Load the XSL stylsheet into the XslCompiledTransform object
myXslTrans.Load(xslPath);
myXslTrans.Transform(xmlDoc, null, Response.Output);
}

My problem is when I execute this code I am getting the following exception. I have a doubt, can we use XmlDocument as a argument to transform to wml.

Exception:

System.Xml.Xsl.XslTransformException: Attribute and namespace nodes cannot be added to the parent element after a text, comment, pi, or sub-element node has already been added. at System.Xml.Xsl.Runtime.XmlQueryOutput.ThrowInvalidStateError(XPathNodeType constructorType) at System.Xml.Xsl.Runtime.XmlQueryOutput.ConstructInEnumAttrs(XPathNodeType rootType) at System.Xml.Xsl.Runtime.XmlQueryOutput.WriteStartAttribute(String prefix, String localName, String ns) at System.Xml.Xsl.Runtime.XmlQueryOutput.WriteStartAttributeLocalName(String localName) at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator ) at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter) at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results) at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, TextWriter results) at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results) at topic.XmlTransformToWML(String hn_xml) in d:\Thesis\Thesis Documentation\Codes From Fuchs\Original HNXML\Mobile Applications\topic.aspx.cs:line 71 at topic.Page_Load(Object sender, EventArgs e) in d:\Thesis\Thesis Documentation\Codes From Fuchs\Original HNXML\Mobile Applications\topic.aspx.cs:line 40



Any ideas would be appreaciated.

Thanks
Aruna.G


Aruna.G
AnswerRe: Urgent.................. Pin
John-ph6-Nov-07 21:15
John-ph6-Nov-07 21:15 
GeneralUrgent.................. Pin
SreejithAchutan6-Nov-07 21:32
SreejithAchutan6-Nov-07 21:32 
GeneralRe: Urgent.................. Pin
Piyush Vardhan Singh6-Nov-07 21:43
Piyush Vardhan Singh6-Nov-07 21:43 
GeneralRe: Urgent.................. Pin
John-ph6-Nov-07 22:09
John-ph6-Nov-07 22:09 
GeneralUrgent.................. Pin
SreejithAchutan6-Nov-07 22:24
SreejithAchutan6-Nov-07 22:24 
Questiondata sending problem. Pin
Sonia Gupta6-Nov-07 20:04
Sonia Gupta6-Nov-07 20:04 
AnswerRe: data sending problem. Pin
Riza Azmi6-Nov-07 20:09
Riza Azmi6-Nov-07 20:09 
GeneralRe: data sending problem. Pin
Sonia Gupta6-Nov-07 20:19
Sonia Gupta6-Nov-07 20:19 
GeneralRe: data sending problem. Pin
Riza Azmi6-Nov-07 20:29
Riza Azmi6-Nov-07 20:29 
AnswerRe: data sending problem. Pin
N a v a n e e t h6-Nov-07 20:16
N a v a n e e t h6-Nov-07 20:16 
GeneralRe: data sending problem. Pin
Sonia Gupta6-Nov-07 20:20
Sonia Gupta6-Nov-07 20:20 
GeneralRe: data sending problem. Pin
N a v a n e e t h6-Nov-07 20:23
N a v a n e e t h6-Nov-07 20:23 
GeneralRe: data sending problem. Pin
Sonia Gupta6-Nov-07 20:39
Sonia Gupta6-Nov-07 20:39 
GeneralRe: data sending problem. Pin
N a v a n e e t h6-Nov-07 20:44
N a v a n e e t h6-Nov-07 20:44 
GeneralRe: data sending problem. Pin
Sonia Gupta6-Nov-07 22:08
Sonia Gupta6-Nov-07 22:08 
Questionhow to use the value of textBox placed on one page on to another page Pin
mavii6-Nov-07 19:34
mavii6-Nov-07 19:34 
AnswerRe: how to use the value of textBox placed on one page on to another page Pin
Riza Azmi6-Nov-07 19:45
Riza Azmi6-Nov-07 19:45 

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.