Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. XSLT and asp.NET mixture

XSLT and asp.NET mixture

Scheduled Pinned Locked Moved XML / XSL
xmlcsharpquestionasp-netsysadmin
3 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    ceviz
    wrote on last edited by
    #1

    Hello there. My question is kinda hard to explain, I know. But I'll give it a shot. Hope it works:) I have a page(product.aspx) with is formed by an xslt and this xslt gets the values from product.xml.

    protected void Page\_Load(object sender, EventArgs e)
    {
        string bebek = Request.QueryString\["id"\];
    
        XmlDocument xdoc = new XmlDocument();
    
        xdoc.Load(Server.MapPath("product.xml"));
    
        XslCompiledTransform xsltran = new XslCompiledTransform();
    
        xsltran.Load(Server.MapPath("pdetail.xsl"));
    
        xsltran.Transform(xdoc, null, Response.Output);
    

    Not, somehow I managed to link the products with a link like detail.aspx?id={product id, lets say 2}. Now I created a page named detail.aspx, getting the id of the product and trying the same method to construct the sheet. Here is my code at pdetail.xsl which need some aid:) <xsl:for-each select="root/product/pid="'id'"> i tried <xsl:for-each select="root/product/pid="{id}"> but i wont work. I will sort the data with the id which I aim to retrieve by the link. Some of you might say, "dont be a noob, just use asp.net facilities to make it." :) you might be right but I am not that hard coder here. phew...hope I made it clear:confused: ps: I use C# for .Net.

    N A 2 Replies Last reply
    0
    • C ceviz

      Hello there. My question is kinda hard to explain, I know. But I'll give it a shot. Hope it works:) I have a page(product.aspx) with is formed by an xslt and this xslt gets the values from product.xml.

      protected void Page\_Load(object sender, EventArgs e)
      {
          string bebek = Request.QueryString\["id"\];
      
          XmlDocument xdoc = new XmlDocument();
      
          xdoc.Load(Server.MapPath("product.xml"));
      
          XslCompiledTransform xsltran = new XslCompiledTransform();
      
          xsltran.Load(Server.MapPath("pdetail.xsl"));
      
          xsltran.Transform(xdoc, null, Response.Output);
      

      Not, somehow I managed to link the products with a link like detail.aspx?id={product id, lets say 2}. Now I created a page named detail.aspx, getting the id of the product and trying the same method to construct the sheet. Here is my code at pdetail.xsl which need some aid:) <xsl:for-each select="root/product/pid="'id'"> i tried <xsl:for-each select="root/product/pid="{id}"> but i wont work. I will sort the data with the id which I aim to retrieve by the link. Some of you might say, "dont be a noob, just use asp.net facilities to make it." :) you might be right but I am not that hard coder here. phew...hope I made it clear:confused: ps: I use C# for .Net.

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      ceviz wrote:

      "dont be a noob, just use asp.net facilities to make it."

      Yes, exactly. Use a repeater, datalist, datagrid, whatever and set the datasource to your xml file.

      ceviz wrote:

      am not that hard coder here.

      Then learn. The tools are there to help you work smarter so you don't have to do it the hard way.


      I know the language. I've read a book. - _Madmatt

      1 Reply Last reply
      0
      • C ceviz

        Hello there. My question is kinda hard to explain, I know. But I'll give it a shot. Hope it works:) I have a page(product.aspx) with is formed by an xslt and this xslt gets the values from product.xml.

        protected void Page\_Load(object sender, EventArgs e)
        {
            string bebek = Request.QueryString\["id"\];
        
            XmlDocument xdoc = new XmlDocument();
        
            xdoc.Load(Server.MapPath("product.xml"));
        
            XslCompiledTransform xsltran = new XslCompiledTransform();
        
            xsltran.Load(Server.MapPath("pdetail.xsl"));
        
            xsltran.Transform(xdoc, null, Response.Output);
        

        Not, somehow I managed to link the products with a link like detail.aspx?id={product id, lets say 2}. Now I created a page named detail.aspx, getting the id of the product and trying the same method to construct the sheet. Here is my code at pdetail.xsl which need some aid:) <xsl:for-each select="root/product/pid="'id'"> i tried <xsl:for-each select="root/product/pid="{id}"> but i wont work. I will sort the data with the id which I aim to retrieve by the link. Some of you might say, "dont be a noob, just use asp.net facilities to make it." :) you might be right but I am not that hard coder here. phew...hope I made it clear:confused: ps: I use C# for .Net.

        A Offline
        A Offline
        Atwind
        wrote on last edited by
        #3

        try /pid[@id] I dont know the xml docment .

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups