Migrating an Xml control using XslTransform

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • WT

    Migrating an Xml control using XslTransform

    Hello,

    I have code created with .net 1.0 and migrated to 3.5.
    Form 2.0 the XslTransform class is obsolete and the vs2008 compiler
    generates warnings that these classes are absolete suggesting to use
    XslCompiledTran sform.
    But all this was rendered using an Xml control and I can't find a way to
    relate this control to an XslCompiledTran sform ?

    Any help appreciated to solve this migration pb.

    CS

  • Leon Mayne

    #2
    Re: Migrating an Xml control using XslTransform

    "WT" <WT@newsgroups. nospamwrote in message
    news:A60A14D6-5D97-4D97-9DF4-8CD98C245E98@mi crosoft.com...
    I have code created with .net 1.0 and migrated to 3.5.
    Form 2.0 the XslTransform class is obsolete and the vs2008 compiler
    generates warnings that these classes are absolete suggesting to use
    XslCompiledTran sform.
    But all this was rendered using an Xml control and I can't find a way to
    relate this control to an XslCompiledTran sform ?
    Could you post the code causing the error? Do you have references to
    XslTransform objects in the code behind files? You should be able to just
    replace them using code like:

    Dim xdoc As New XmlDocument
    xdoc.LoadXml(st rYourXml)
    Dim xsdoc As New XslCompiledTran sform()
    xsdoc.Load(xslt FilePath)
    Dim sw As New StringWriter
    xsdoc.Transform (xdoc.CreateNav igator(), Nothing, sw)
    strTransformed = sw.ToString

    Comment

    • WT

      #3
      Re: Migrating an Xml control using XslTransform

      Thanks for answer, but the problem is not here it is in the usage of the Xml
      control to display the page, my code is like this:
      xt = new XslTransform();
      xslt = Server.MapPath( xslt);
      XmlUrlResolver xr = new XmlUrlResolver( );
      xt.Load(xslt,xr );

      // create the ArgList
      XsltArgumentLis t xa = new XsltArgumentLis t();
      XslHelper xh = new XslHelper();
      xa.AddExtension Object("urn:MyE xt",xh);
      AddParam(xa,"La nguageRequested ",string.Empty, lang.Name);
      AddParam(xa,"La nguageReturned" ,string.Empty,l anguageReturned );
      AddParam(xa,"As Requested",stri ng.Empty,asRequ ested.ToString( ));
      AddParam(xa,"Lo cation",string. Empty,loc);
      AddParam(xa,"Ti tle",string.Emp ty,Title);
      AddParam(xa,"Vi ewer",string.Em pty,Request.Url .AbsolutePath);
      AddParam(xa,"my Root",string.Em pty,loc.Substri ng(0,loc.IndexO f("/")));

      // load up the Xml control
      myXml.DocumentS ource = filePath;
      myXml.Transform = xt;
      myXml.Transform ArgumentList = xa;


      Problem is in the last 3 lines, MS doc for Xml control speaks about some
      possibility to use XslCompiledTran sform for this control in place of
      XslTransform but how, I spent time reading all the members and found no one
      able to receive an XslCompiledTran sform ?

      CS






      "Leon Mayne" <leon@rmvme.mvp s.orga écrit dans le message de
      news:98518DD0-CC91-4B7D-9191-306B1002AD37@mi crosoft.com...
      "WT" <WT@newsgroups. nospamwrote in message
      news:A60A14D6-5D97-4D97-9DF4-8CD98C245E98@mi crosoft.com...
      >I have code created with .net 1.0 and migrated to 3.5.
      >Form 2.0 the XslTransform class is obsolete and the vs2008 compiler
      >generates warnings that these classes are absolete suggesting to use
      >XslCompiledTra nsform.
      >But all this was rendered using an Xml control and I can't find a way to
      >relate this control to an XslCompiledTran sform ?
      >
      Could you post the code causing the error? Do you have references to
      XslTransform objects in the code behind files? You should be able to just
      replace them using code like:
      >
      Dim xdoc As New XmlDocument
      xdoc.LoadXml(st rYourXml)
      Dim xsdoc As New XslCompiledTran sform()
      xsdoc.Load(xslt FilePath)
      Dim sw As New StringWriter
      xsdoc.Transform (xdoc.CreateNav igator(), Nothing, sw)
      strTransformed = sw.ToString

      Comment

      • Leon Mayne

        #4
        Re: Migrating an Xml control using XslTransform

        "WT" <WT@newsgroups. nospamwrote in message
        news:87A8DEB3-F2FC-49F9-BFB0-E6F72746F2B6@mi crosoft.com...
        Thanks for answer, but the problem is not here it is in the usage of the
        Xml control to display the page, my code is like this:
        xt = new XslTransform();
        xslt = Server.MapPath( xslt);
        XmlUrlResolver xr = new XmlUrlResolver( );
        xt.Load(xslt,xr );
        >
        // create the ArgList
        XsltArgumentLis t xa = new XsltArgumentLis t();
        XslHelper xh = new XslHelper();
        xa.AddExtension Object("urn:MyE xt",xh);
        AddParam(xa,"La nguageRequested ",string.Empty, lang.Name);
        AddParam(xa,"La nguageReturned" ,string.Empty,l anguageReturned );
        AddParam(xa,"As Requested",stri ng.Empty,asRequ ested.ToString( ));
        AddParam(xa,"Lo cation",string. Empty,loc);
        AddParam(xa,"Ti tle",string.Emp ty,Title);
        AddParam(xa,"Vi ewer",string.Em pty,Request.Url .AbsolutePath);
        AddParam(xa,"my Root",string.Em pty,loc.Substri ng(0,loc.IndexO f("/")));
        >
        // load up the Xml control
        myXml.DocumentS ource = filePath;
        myXml.Transform = xt;
        myXml.Transform ArgumentList = xa;
        >
        >
        Problem is in the last 3 lines, MS doc for Xml control speaks about some
        possibility to use XslCompiledTran sform for this control in place of
        XslTransform but how, I spent time reading all the members and found no
        one able to receive an XslCompiledTran sform ?
        OK, so whatever myXml is has a property called Transform which accepts an
        object of type XslTransform? Do you have the source code for whatever myXml
        is an instance of? If so then you can change its Transform property to
        accept an XslCompiledTran sform and then change all the references to it to
        create a compiled transform instead and pass that in.

        At the end of the day, it might not be worth the effort. You would probably
        spend a lot of time refactoring your code to fix something that isn't
        broken. XslTransform may be deprecated, but it hasn't been removed and it
        still works. If you are likely to rewrite all the controls before the next
        major release of VS & the .NET framework then you might as well wait until
        then.

        Comment

        • WT

          #5
          Re: Migrating an Xml control using XslTransform

          The control is the asp.net standard Xml control.
          I have tried something base on your code and using the DoucmentContent
          property:

          XmlDocument xdoc = new XmlDocument();
          xdoc.Load(fileP ath);
          xt = new XslCompiledTran sform();
          xslt = Server.MapPath( xslt);
          XmlUrlResolver xr = new XmlUrlResolver( );
          xt.Load(xslt,nu ll,xr);
          StringWriter sw = new StringWriter();
          xt.Transform(xd oc.CreateNaviga tor(),xa,sw);
          myXml.DocumentC ontent = sw.ToString();

          need to check now.
          Anyway thanks.

          CS
          "Leon Mayne" <leon@rmvme.mvp s.orga écrit dans le message de
          news:02C0C2E1-FF5D-40FA-BCEE-65A0408BC558@mi crosoft.com...
          "WT" <WT@newsgroups. nospamwrote in message
          news:87A8DEB3-F2FC-49F9-BFB0-E6F72746F2B6@mi crosoft.com...
          >Thanks for answer, but the problem is not here it is in the usage of the
          >Xml control to display the page, my code is like this:
          > xt = new XslTransform();
          > xslt = Server.MapPath( xslt);
          > XmlUrlResolver xr = new XmlUrlResolver( );
          > xt.Load(xslt,xr );
          >>
          > // create the ArgList
          > XsltArgumentLis t xa = new XsltArgumentLis t();
          > XslHelper xh = new XslHelper();
          > xa.AddExtension Object("urn:MyE xt",xh);
          > AddParam(xa,"La nguageRequested ",string.Empty, lang.Name);
          > AddParam(xa,"La nguageReturned" ,string.Empty,l anguageReturned );
          > AddParam(xa,"As Requested",stri ng.Empty,asRequ ested.ToString( ));
          > AddParam(xa,"Lo cation",string. Empty,loc);
          > AddParam(xa,"Ti tle",string.Emp ty,Title);
          > AddParam(xa,"Vi ewer",string.Em pty,Request.Url .AbsolutePath);
          > AddParam(xa,"my Root",string.Em pty,loc.Substri ng(0,loc.IndexO f("/")));
          >>
          > // load up the Xml control
          > myXml.DocumentS ource = filePath;
          > myXml.Transform = xt;
          > myXml.Transform ArgumentList = xa;
          >>
          >>
          >Problem is in the last 3 lines, MS doc for Xml control speaks about some
          >possibility to use XslCompiledTran sform for this control in place of
          >XslTransform but how, I spent time reading all the members and found no
          >one able to receive an XslCompiledTran sform ?
          >
          OK, so whatever myXml is has a property called Transform which accepts an
          object of type XslTransform? Do you have the source code for whatever
          myXml is an instance of? If so then you can change its Transform property
          to accept an XslCompiledTran sform and then change all the references to it
          to create a compiled transform instead and pass that in.
          >
          At the end of the day, it might not be worth the effort. You would
          probably spend a lot of time refactoring your code to fix something that
          isn't broken. XslTransform may be deprecated, but it hasn't been removed
          and it still works. If you are likely to rewrite all the controls before
          the next major release of VS & the .NET framework then you might as well
          wait until then.

          Comment

          • Steven Cheng [MSFT]

            #6
            Re: Migrating an Xml control using XslTransform

            Hi CS,

            As for the XML control, it does be an existing issue that the 2.0 control
            of ASP.NET XML doesn't correctly exposed the "Transform" property as
            "XslCompiledTra nsform" class. This make it raise "obsolete" error when you
            try perform transforming on some complex xslt template(such as the ones
            that will require additional custom arguements) since such xslt will need
            dynamic compilation of the XSLT transform which will raise error.

            So far, I think the following code you posted (which programmtically use
            XslCompiledTran sform class to do the XSL transforming) is reasonable:

            ============
            XmlDocument xdoc = new XmlDocument();
            xdoc.Load(fileP ath);
            xt = new XslCompiledTran sform();
            xslt = Server.MapPath( xslt);
            XmlUrlResolver xr = new XmlUrlResolver( );
            xt.Load(xslt,nu ll,xr);
            StringWriter sw = new StringWriter();
            xt.Transform(xd oc.CreateNaviga tor(),xa,sw);
            myXml.DocumentC ontent = sw.ToString();
            =============== =

            Also, on the page, you can put a ASP.NET Literal control instead of Xml
            control and assign the transfored result content to the Literal control's
            Text propety.

            Sincerely,

            Steven Cheng

            Microsoft MSDN Online Support Lead


            Delighting our customers is our #1 priority. We welcome your comments and
            suggestions about how we can improve the support we provide to you. Please
            feel free to let my manager know what you think of the level of service
            provided. You can send feedback directly to my manager at:
            msdnmg@microsof t.com.

            =============== =============== =============== =====
            Get notification to my posts through email? Please refer to
            Gain technical skills through documentation and training, earn certifications and connect with the community

            ications.

            Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
            where an initial response from the community or a Microsoft Support
            Engineer within 1 business day is acceptable. Please note that each follow
            up response may take approximately 2 business days as the support
            professional working with you may need further investigation to reach the
            most efficient resolution. The offering is not appropriate for situations
            that require urgent, real-time or phone-based interactions or complex
            project analysis and dump analysis issues. Issues of this nature are best
            handled working with a dedicated Microsoft Support Engineer by contacting
            Microsoft Customer Support Services (CSS) at
            http://msdn.microsoft.com/subscripti...t/default.aspx.
            =============== =============== =============== =====
            This posting is provided "AS IS" with no warranties, and confers no rights.

            --------------------
            >From: "WT" <WT@newsgroups. nospam>
            >References: <A60A14D6-5D97-4D97-9DF4-8CD98C245E98@mi crosoft.com>
            <98518DD0-CC91-4B7D-9191-306B1002AD37@mi crosoft.com>
            <87A8DEB3-F2FC-49F9-BFB0-E6F72746F2B6@mi crosoft.com>
            <02C0C2E1-FF5D-40FA-BCEE-65A0408BC558@mi crosoft.com>
            >In-Reply-To: <02C0C2E1-FF5D-40FA-BCEE-65A0408BC558@mi crosoft.com>
            >Subject: Re: Migrating an Xml control using XslTransform
            >Date: Fri, 16 May 2008 17:00:07 +0200
            >
            >The control is the asp.net standard Xml control.
            >I have tried something base on your code and using the DoucmentContent
            >property:
            >
            XmlDocument xdoc = new XmlDocument();
            xdoc.Load(fileP ath);
            xt = new
            XslCompiledTran sform();
            xslt = Server.MapPath( xslt);
            XmlUrlResolver xr = new XmlUrlResolver( );
            xt.Load(xslt,nu ll,xr);
            StringWriter sw = new StringWriter();
            xt.Transform(xd oc.CreateNaviga tor(),xa,sw);
            myXml.DocumentC ontent = sw.ToString();
            >
            >need to check now.
            >Anyway thanks.
            >
            >CS
            >"Leon Mayne" <leon@rmvme.mvp s.orga écrit dans le message de
            >news:02C0C2E 1-FF5D-40FA-BCEE-65A0408BC558@mi crosoft.com...
            >"WT" <WT@newsgroups. nospamwrote in message
            >news:87A8DEB 3-F2FC-49F9-BFB0-E6F72746F2B6@mi crosoft.com...
            >>Thanks for answer, but the problem is not here it is in the usage of
            the
            >>Xml control to display the page, my code is like this:
            >> xt = new XslTransform();
            >> xslt = Server.MapPath( xslt);
            >> XmlUrlResolver xr = new XmlUrlResolver( );
            >> xt.Load(xslt,xr );
            >>>
            >> // create the ArgList
            >> XsltArgumentLis t xa = new XsltArgumentLis t();
            >> XslHelper xh = new XslHelper();
            >> xa.AddExtension Object("urn:MyE xt",xh);
            >> AddParam(xa,"La nguageRequested ",string.Empty, lang.Name);
            >> AddParam(xa,"La nguageReturned" ,string.Empty,l anguageReturned );
            >> AddParam(xa,"As Requested",stri ng.Empty,asRequ ested.ToString( ));
            >> AddParam(xa,"Lo cation",string. Empty,loc);
            >> AddParam(xa,"Ti tle",string.Emp ty,Title);
            >> AddParam(xa,"Vi ewer",string.Em pty,Request.Url .AbsolutePath);
            >> AddParam(xa,"my Root",string.Em pty,loc.Substri ng(0,loc.IndexO f("/")));
            >>>
            >> // load up the Xml control
            >> myXml.DocumentS ource = filePath;
            >> myXml.Transform = xt;
            >> myXml.Transform ArgumentList = xa;
            >>>
            >>>
            >>Problem is in the last 3 lines, MS doc for Xml control speaks about
            some
            >>possibility to use XslCompiledTran sform for this control in place of
            >>XslTransfor m but how, I spent time reading all the members and found no
            >>one able to receive an XslCompiledTran sform ?
            >>
            >OK, so whatever myXml is has a property called Transform which accepts
            an
            >object of type XslTransform? Do you have the source code for whatever
            >myXml is an instance of? If so then you can change its Transform
            property
            >to accept an XslCompiledTran sform and then change all the references to
            it
            >to create a compiled transform instead and pass that in.
            >>
            >At the end of the day, it might not be worth the effort. You would
            >probably spend a lot of time refactoring your code to fix something that
            >isn't broken. XslTransform may be deprecated, but it hasn't been removed
            >and it still works. If you are likely to rewrite all the controls before
            >the next major release of VS & the .NET framework then you might as well
            >wait until then.
            >
            >

            Comment

            • WT

              #7
              Re: Migrating an Xml control using XslTransform

              Thanks Steven.
              CS
              "Steven Cheng [MSFT]" <stcheng@online .microsoft.coma écrit dans le message
              de news:r4w5HgWuIH A.1784@TK2MSFTN GHUB02.phx.gbl. ..
              Hi CS,
              >
              As for the XML control, it does be an existing issue that the 2.0 control
              of ASP.NET XML doesn't correctly exposed the "Transform" property as
              "XslCompiledTra nsform" class. This make it raise "obsolete" error when you
              try perform transforming on some complex xslt template(such as the ones
              that will require additional custom arguements) since such xslt will need
              dynamic compilation of the XSLT transform which will raise error.
              >
              So far, I think the following code you posted (which programmtically use
              XslCompiledTran sform class to do the XSL transforming) is reasonable:
              >
              ============
              XmlDocument xdoc = new XmlDocument();
              xdoc.Load(fileP ath);
              xt = new
              XslCompiledTran sform();
              xslt = Server.MapPath( xslt);
              XmlUrlResolver xr = new XmlUrlResolver( );
              xt.Load(xslt,nu ll,xr);
              StringWriter sw = new StringWriter();
              xt.Transform(xd oc.CreateNaviga tor(),xa,sw);
              myXml.DocumentC ontent = sw.ToString();
              =============== =
              >
              Also, on the page, you can put a ASP.NET Literal control instead of Xml
              control and assign the transfored result content to the Literal control's
              Text propety.
              >
              Sincerely,
              >
              Steven Cheng
              >
              Microsoft MSDN Online Support Lead
              >
              >
              Delighting our customers is our #1 priority. We welcome your comments and
              suggestions about how we can improve the support we provide to you. Please
              feel free to let my manager know what you think of the level of service
              provided. You can send feedback directly to my manager at:
              msdnmg@microsof t.com.
              >
              =============== =============== =============== =====
              Get notification to my posts through email? Please refer to
              Gain technical skills through documentation and training, earn certifications and connect with the community

              ications.
              >
              Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
              where an initial response from the community or a Microsoft Support
              Engineer within 1 business day is acceptable. Please note that each follow
              up response may take approximately 2 business days as the support
              professional working with you may need further investigation to reach the
              most efficient resolution. The offering is not appropriate for situations
              that require urgent, real-time or phone-based interactions or complex
              project analysis and dump analysis issues. Issues of this nature are best
              handled working with a dedicated Microsoft Support Engineer by contacting
              Microsoft Customer Support Services (CSS) at
              http://msdn.microsoft.com/subscripti...t/default.aspx.
              =============== =============== =============== =====
              This posting is provided "AS IS" with no warranties, and confers no
              rights.
              >
              --------------------
              >>From: "WT" <WT@newsgroups. nospam>
              >>References: <A60A14D6-5D97-4D97-9DF4-8CD98C245E98@mi crosoft.com>
              <98518DD0-CC91-4B7D-9191-306B1002AD37@mi crosoft.com>
              <87A8DEB3-F2FC-49F9-BFB0-E6F72746F2B6@mi crosoft.com>
              <02C0C2E1-FF5D-40FA-BCEE-65A0408BC558@mi crosoft.com>
              >>In-Reply-To: <02C0C2E1-FF5D-40FA-BCEE-65A0408BC558@mi crosoft.com>
              >>Subject: Re: Migrating an Xml control using XslTransform
              >>Date: Fri, 16 May 2008 17:00:07 +0200
              >>
              >>The control is the asp.net standard Xml control.
              >>I have tried something base on your code and using the DoucmentContent
              >>property:
              >>
              > XmlDocument xdoc = new XmlDocument();
              > xdoc.Load(fileP ath);
              > xt = new
              XslCompiledTran sform();
              > xslt = Server.MapPath( xslt);
              > XmlUrlResolver xr = new XmlUrlResolver( );
              > xt.Load(xslt,nu ll,xr);
              > StringWriter sw = new StringWriter();
              > xt.Transform(xd oc.CreateNaviga tor(),xa,sw);
              > myXml.DocumentC ontent = sw.ToString();
              >>
              >>need to check now.
              >>Anyway thanks.
              >>
              >>CS
              >>"Leon Mayne" <leon@rmvme.mvp s.orga écrit dans le message de
              >>news:02C0C2 E1-FF5D-40FA-BCEE-65A0408BC558@mi crosoft.com...
              >>"WT" <WT@newsgroups. nospamwrote in message
              >>news:87A8DE B3-F2FC-49F9-BFB0-E6F72746F2B6@mi crosoft.com...
              >>>Thanks for answer, but the problem is not here it is in the usage of
              the
              >>>Xml control to display the page, my code is like this:
              >>> xt = new XslTransform();
              >>> xslt = Server.MapPath( xslt);
              >>> XmlUrlResolver xr = new XmlUrlResolver( );
              >>> xt.Load(xslt,xr );
              >>>>
              >>> // create the ArgList
              >>> XsltArgumentLis t xa = new XsltArgumentLis t();
              >>> XslHelper xh = new XslHelper();
              >>> xa.AddExtension Object("urn:MyE xt",xh);
              >>> AddParam(xa,"La nguageRequested ",string.Empty, lang.Name);
              >>> AddParam(xa,"La nguageReturned" ,string.Empty,l anguageReturned );
              >>> AddParam(xa,"As Requested",stri ng.Empty,asRequ ested.ToString( ));
              >>> AddParam(xa,"Lo cation",string. Empty,loc);
              >>> AddParam(xa,"Ti tle",string.Emp ty,Title);
              >>> AddParam(xa,"Vi ewer",string.Em pty,Request.Url .AbsolutePath);
              >>>>
              >>>AddParam(xa, "myRoot",string .Empty,loc.Subs tring(0,loc.Ind exOf("/")));
              >>>>
              >>> // load up the Xml control
              >>> myXml.DocumentS ource = filePath;
              >>> myXml.Transform = xt;
              >>> myXml.Transform ArgumentList = xa;
              >>>>
              >>>>
              >>>Problem is in the last 3 lines, MS doc for Xml control speaks about
              some
              >>>possibilit y to use XslCompiledTran sform for this control in place of
              >>>XslTransfo rm but how, I spent time reading all the members and found no
              >>>one able to receive an XslCompiledTran sform ?
              >>>
              >>OK, so whatever myXml is has a property called Transform which accepts
              an
              >>object of type XslTransform? Do you have the source code for whatever
              >>myXml is an instance of? If so then you can change its Transform
              property
              >>to accept an XslCompiledTran sform and then change all the references to
              it
              >>to create a compiled transform instead and pass that in.
              >>>
              >>At the end of the day, it might not be worth the effort. You would
              >>probably spend a lot of time refactoring your code to fix something that
              >>isn't broken. XslTransform may be deprecated, but it hasn't been removed
              >>and it still works. If you are likely to rewrite all the controls before
              >>the next major release of VS & the .NET framework then you might as well
              >>wait until then.
              >>
              >>
              >

              Comment

              • Steven Cheng [MSFT]

                #8
                Re: Migrating an Xml control using XslTransform

                You're welcome CS.

                Also, I agree that this is an serious problem that cause the ASP.NET xml
                control not quite useful in new version environment. I would also suggest
                you submit your comments and feedback on this so that the product team can
                also hear more on this:



                Sincerely,

                Steven Cheng

                Microsoft MSDN Online Support Lead


                Delighting our customers is our #1 priority. We welcome your comments and
                suggestions about how we can improve the support we provide to you. Please
                feel free to let my manager know what you think of the level of service
                provided. You can send feedback directly to my manager at:
                msdnmg@microsof t.com.

                =============== =============== =============== =====
                Get notification to my posts through email? Please refer to
                Gain technical skills through documentation and training, earn certifications and connect with the community

                ications.

                =============== =============== =============== =====
                This posting is provided "AS IS" with no warranties, and confers no rights.
                --------------------
                >In-Reply-To: <r4w5HgWuIHA.17 84@TK2MSFTNGHUB 02.phx.gbl>
                >Subject: Re: Migrating an Xml control using XslTransform
                >Date: Mon, 19 May 2008 14:47:03 +0200
                >
                >Thanks Steven.
                >CS
                >"Steven Cheng [MSFT]" <stcheng@online .microsoft.coma écrit dans le
                message
                >de news:r4w5HgWuIH A.1784@TK2MSFTN GHUB02.phx.gbl. ..
                >Hi CS,
                >>
                >As for the XML control, it does be an existing issue that the 2.0 control
                >of ASP.NET XML doesn't correctly exposed the "Transform" property as
                >"XslCompiledTr ansform" class. This make it raise "obsolete" error when
                you
                >try perform transforming on some complex xslt template(such as the ones
                >that will require additional custom arguements) since such xslt will need
                >dynamic compilation of the XSLT transform which will raise error.
                >>
                >So far, I think the following code you posted (which programmtically use
                >XslCompiledTra nsform class to do the XSL transforming) is reasonable:
                >>
                >============
                > XmlDocument xdoc = new XmlDocument();
                > xdoc.Load(fileP ath);
                > xt = new
                >XslCompiledTra nsform();
                > xslt = Server.MapPath( xslt);
                > XmlUrlResolver xr = new XmlUrlResolver( );
                > xt.Load(xslt,nu ll,xr);
                > StringWriter sw = new StringWriter();
                > xt.Transform(xd oc.CreateNaviga tor(),xa,sw);
                > myXml.DocumentC ontent = sw.ToString();
                >============== ==
                >>
                >Also, on the page, you can put a ASP.NET Literal control instead of Xml
                >control and assign the transfored result content to the Literal control's
                >Text propety.
                >>
                >Sincerely,
                >>
                >Steven Cheng
                >>
                >M

                Comment

                • WT

                  #9
                  Re: Migrating an Xml control using XslTransform

                  Done.
                  "Steven Cheng [MSFT]" <stcheng@online .microsoft.coma écrit dans le message
                  de news:fhzy3DiuIH A.3708@TK2MSFTN GHUB02.phx.gbl. ..
                  You're welcome CS.
                  >
                  Also, I agree that this is an serious problem that cause the ASP.NET xml
                  control not quite useful in new version environment. I would also suggest
                  you submit your comments and feedback on this so that the product team
                  can
                  also hear more on this:
                  >

                  >
                  Sincerely,
                  >
                  Steven Cheng
                  >
                  Microsoft MSDN Online Support Lead
                  >
                  >
                  Delighting our customers is our #1 priority. We welcome your comments and
                  suggestions about how we can improve the support we provide to you. Please
                  feel free to let my manager know what you think of the level of service
                  provided. You can send feedback directly to my manager at:
                  msdnmg@microsof t.com.
                  >
                  =============== =============== =============== =====
                  Get notification to my posts through email? Please refer to
                  Gain technical skills through documentation and training, earn certifications and connect with the community

                  ications.
                  >
                  =============== =============== =============== =====
                  This posting is provided "AS IS" with no warranties, and confers no
                  rights.
                  --------------------
                  >>In-Reply-To: <r4w5HgWuIHA.17 84@TK2MSFTNGHUB 02.phx.gbl>
                  >>Subject: Re: Migrating an Xml control using XslTransform
                  >>Date: Mon, 19 May 2008 14:47:03 +0200
                  >
                  >>
                  >>Thanks Steven.
                  >>CS
                  >>"Steven Cheng [MSFT]" <stcheng@online .microsoft.coma écrit dans le
                  message
                  >>de news:r4w5HgWuIH A.1784@TK2MSFTN GHUB02.phx.gbl. ..
                  >>Hi CS,
                  >>>
                  >>As for the XML control, it does be an existing issue that the 2.0
                  >>control
                  >>of ASP.NET XML doesn't correctly exposed the "Transform" property as
                  >>"XslCompiledT ransform" class. This make it raise "obsolete" error when
                  you
                  >>try perform transforming on some complex xslt template(such as the ones
                  >>that will require additional custom arguements) since such xslt will
                  >>need
                  >>dynamic compilation of the XSLT transform which will raise error.
                  >>>
                  >>So far, I think the following code you posted (which programmtically use
                  >>XslCompiledTr ansform class to do the XSL transforming) is reasonable:
                  >>>
                  >>=========== =
                  >> XmlDocument xdoc = new XmlDocument();
                  >> xdoc.Load(fileP ath);
                  >> xt = new
                  >>XslCompiledTr ansform();
                  >> xslt = Server.MapPath( xslt);
                  >> XmlUrlResolver xr = new XmlUrlResolver( );
                  >> xt.Load(xslt,nu ll,xr);
                  >> StringWriter sw = new StringWriter();
                  >> xt.Transform(xd oc.CreateNaviga tor(),xa,sw);
                  >> myXml.DocumentC ontent = sw.ToString();
                  >>============= ===
                  >>>
                  >>Also, on the page, you can put a ASP.NET Literal control instead of Xml
                  >>control and assign the transfored result content to the Literal
                  >>control's
                  >>Text propety.
                  >>>
                  >>Sincerely,
                  >>>
                  >>Steven Cheng
                  >>>
                  >>M
                  >

                  Comment

                  • Steven Cheng [MSFT]

                    #10
                    Re: Migrating an Xml control using XslTransform

                    Thank you!
                    --------------------
                    >From: "WT" <WT@newsgroups. nospam>
                    >Subject: Re: Migrating an Xml control using XslTransform
                    >Date: Tue, 20 May 2008 12:43:40 +0200
                    >
                    >Done.
                    >"Steven Cheng [MSFT]" <stcheng@online .microsoft.coma écrit dans le
                    message
                    >de news:fhzy3DiuIH A.3708@TK2MSFTN GHUB02.phx.gbl. ..
                    >You're welcome CS.
                    >>
                    >Also, I agree that this is an serious problem that cause the ASP.NET xml
                    >control not quite useful in new version environment. I would also suggest
                    >you submit your comments and feedback on this so that the product team
                    >can
                    >also hear more on this:
                    >>
                    >http://connect.microsoft.com/feedbac...spx?SiteID=210
                    >>
                    >Sincerely,
                    >>
                    >Steven Cheng
                    >>
                    >Microsoft MSDN Online Support Lead
                    >>
                    >>
                    >Delighting our customers is our #1 priority. We welcome your comments and
                    >suggestions about how we can improve the support we provide to you.
                    Please
                    >feel free to let my manager know what you think of the level of service
                    >provided. You can send feedback directly to my manager at:
                    >msdnmg@microsof t.com.
                    >>
                    >============== =============== =============== ======
                    >Get notification to my posts through email? Please refer to
                    >>
                    http://msdn.microsoft.com/subscripti...ult.aspx#notif
                    >ications.
                    >>
                    >=

                    Comment

                    Working...