how do i use vs.net 2003 to import the xml document and xslt
to my .aspx
Main Topics
Browse All TopicsHi guys,
I managed to create a XML File .xml, XLST stylesheet .xsl in notepad
to be displayed in my .aspx report.
I will create my .aspx page layout with a panel.
1. I'm not gd with VS.NET but i just installed it, what kind of "new project"
do i create, ASP.NET Web Application or Web Service?
2. How do i add the xml file and xlst sheet i created to this solution?
3. How do i add the data from the xml file using xml control to the .aspx page
4. How do i modify the XML control properties to point to the XML document and XSLT stylesheet.
5. How do i edit my stylesheet or report to make it look better, which controls/settings do i use
help appreciated!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
To format the XSLT, you can do the following:
1. Manually make the changes in the XSLT document. See the resultant changes. Cost $0.
2. Use XmlSpy. Cost $$$
OR
3. Use Xselerator (found in www.topxml.com)
I just do it manually but then again I am used to the XSLT syntax.
1. The setting up of the Xml Control in the ASP.NET Page with the proper settings is all that is needed for the display of the transformation.
2. An ASP.NET Panel merely outputs as a DIV element on the browser. To use the XmlControl inside the Panel at design time:
<asp:Panel Id="MyPanel" runat="server">
<asp:Xml Id="MyXml" runat="server" />
</asp:Panel>
3. To format your report, you will need to know the XSLT syntax. You can learn some of it from www.w3schools.com as well as www.topxml.com
4. Do not expect to be able to master every technique of transformations overnight. That is something that will remain an ongoing task.
>>
i wish to display and format a report based on values inside .xml and .xsl
<<
Your question indicates some confusion about XML and XSLT documents. XML documents hold data preferably in a hierarchical structure. XSLT documents hold the styling rules: they handle the presentation rules. If you are talking about formatting a report using transformations (as the Xml control does it discretely), then you must be able to code the XSLT document either manually (not recommended) or with the use of 3rd Party software (recommended).
In order for you to have an idea about how this all works, you will need to provide a very small snippet of XML and your expected result/display after a transformation. There's only so much this medium can provide. A lot depends on you reading up =)
Business Accounts
Answer for Membership
by: b1xml2Posted on 2005-09-12 at 17:18:23ID: 14868429
to use the xml control:
rg/1999/XS L/Transfor m">
Source = "Xml/data.xml"; mSource = "Xml/data.xslt";
llo World!</root>"); = document; mSource = "Xml/data.xslt";
llo World!</root>")
Path: Xml/data.xml
==============
<?xml version="1.0" encoding="utf-8" ?>
<root>Hello World!</root>
Path: Xml/data.xslt
=================
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.o
<xsl:output method="html" encoding="utf-8" />
<xsl:template match="/">
<xsl:value-of select="." />
</xsl:template>
</xsl:stylesheet>
C# ASP.NET
========
<%@Page Language="C#"%>
<script language="C#" runat="server">
void Page_Load(object sender,EventArgs e)
{
this.MyXmlControl.Document
this.MyXmlControl.Transfor
}
</script>
<asp:Xml ID="MyXmlControl" runat="server" />
VB.NET ASP.NET
============
<%@Page Language="VB"%>
<script language="vb" runat="server">
Sub Page_Load(ByVal sender AS Object, ByVal e As EventArgs)
With MyXmlControl
.DocumentSource = "Xml/data.xml"
.TransformSource = "Xml/data.xslt"
End With
End Sub
</script>
<asp:Xml ID="MyXmlControl" runat="server" />
Output in both cases
==============
Hello World!
Notes
=====
1. The DocumentSource property will accept virtual paths. The same applies to the TransformSource. If you want to pass an XmlDocument instead of just a string value denoting the path, you use the Document property like so:
C# and ASP.NET
===========
<%@Page Language="C#"%>
<%@Import Namespace="System.Xml"%>
<script language="C#" runat="server">
void Page_Load(object sender,EventArgs e)
{
XmlDocument document = new XmlDocument();
document.LoadXml("<root>He
this.MyXmlControl.Document
this.MyXmlControl.Transfor
}
</script>
<asp:Xml ID="MyXmlControl" runat="server" />
VB.NET and ASP.NET
==============
<%@Page Language="VB"%>
<%@Import Namespace="System.Xml"%>
<script language="vb" runat="server">
Sub Page_Load(ByVal sender AS Object, ByVal e As EventArgs)
Dim document As New XmlDocument
document.LoadXml("<root>He
With MyXmlControl
.Document = document
.TransformSource = "Xml/data.xslt"
End With
End Sub
</script>
<asp:Xml ID="MyXmlControl" runat="server" />
2. The question of using XSLT documents to style the output is something you will have to learn outside of EE per se. There's just too much information plus the fact that you now have version 2.0 floating around.
Final Note:
=========
The more general your question is, the more general the answer will be.
Cheers,
Brandon