XML Transform

I am using Asp.Net and wondered if the TransformNode is outdated to use??

This may sound pretty silly but can someone tell me why I receive this error message:
   BC30456: 'transformNode' is not a member of 'System.Xml.XmlDocument'.


from this line of coding:

response.write(xmlDoc.transformNode(xsl))

thanks!
bearpawsAsked:
Who is Participating?
 
sivic82Connect With a Mentor Commented:
Goto the designer view and drop in the xml control. This control allows you to transform the xml with xsl. Once you drop the control in click on it and set the transformsource property to point to your xsl document.

Then switch to your codebehind and reference the xml control you dropped in..

XmlControl1.document = MyXmlDocument
0
 
bearpawsAuthor Commented:
I have a version in which I did that, and I receive this error:
(I can not win with this wimple task :((()

<%@ Page Language="VB" %>
<%@ import Namespace="System.IO" %>
<%@ import Namespace="System.Xml.XPath" %>
<%@ import Namespace="System.Xml" %>
<%@ import Namespace="System.Xml.Xsl" %>
<%@ import Namespace="System.Xml.XmlDocument" %>
<script runat="server">

    dim myXmlDocument as New XMLDocument()
   
    myXmlDocument = Xml1.Document

</script>
<html>
<head>
</head>
<body>
    <form runat="server">
        <asp:Xml id="Xml1" runat="server" TransformSource="myTest.xsl" DocumentSource="myTest.xml"></asp:Xml>
    </form>
</body>
</html>
0
 
bearpawsAuthor Commented:
forogot to add the error message

Error BC30188: Declaration expected.

this is confusing....sigh
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
bearpawsAuthor Commented:
I got it! Here's the solution! Yahoo!


<%@ Page Language="VB" %>
<%@ import Namespace="System.Xml" %>
<%@ import Namespace="System.Xml.Xsl" %>
<script runat="server">

    Sub Page_Load(sender As Object, e As EventArgs)
       Dim objDoc As XmlDocument = New XmlDocument()
       Dim objTrans As XslTransform = new XslTransform()

       objDoc.Load(Server.MapPath("test.xml"))


       objTrans.Load(Server.MapPath("test.xsl"))

       xml1.Document = objDoc
       xml1.Transform = objTrans
    End Sub

</script>
0
 
bearpawsAuthor Commented:
I am awarding you points for taking the time to response and so forth - :-)
0
 
sivic82Commented:
In your other example you just tried to set the xml document to the control when it should have been the other way around..

  dim myXmlDocument as New XMLDocument()
  myXmlDocument = Xml1.Document

should be

  dim myXmlDocument as New XMLDocument()
  Xml1.Document = myXmlDocument

But im glad you got it fixed thats all that matters.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.