Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying XMLNode on Web Page

Status
Not open for further replies.

lumstar

Technical User
Jan 29, 2002
177
CA
Hi Guys,

I have created a web services that returns an XMLNode. I have a .XSL file to format the xml. I want to know how to display the XMLNode on the page. Here is how I call the webservice:

XmlNode xmlData = webserv.GetItems();

My xsl file is called DispPubs.xsl.

How would I go about displaying the xml file on the web page?

Thanks in advance for your time.

Lumstar
______________________________________
And The Star Continues To Shine....
 
In case anyone was wondering this is how it is done:

private void Page_Load(object sender, System.EventArgs e)
{
//create webservice
webserv = new Service1();

//run the search (gets * from article table)
XmlNode xmlData = webserv.GetItems();

DataSet ds = new DataSet();
XmlNodeReader xnr = new XmlNodeReader(xmlData);
ds.ReadXml(xnr);

//read the xmlschema
StreamReader finschema = new StreamReader("dispPubs.xsl");

//Read the Schema into the DataSet
ds.ReadXmlSchema(finschema);

//Close the FileStream
finschema.Close();



foreach(DataRow dr in ds.Tables[0].Rows)
{
Response.Write(dr["LastName"].ToString()+ ", "+dr["FirstName"].ToString()
+"<br><t>"+dr["Title"].ToString()+"<br><br>");

}
}

Lumstar
______________________________________
And The Star Continues To Shine....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top