Xpath problem - yikes!

Discussion in 'ASP .Net' started by cyphos, Dec 7, 2004.

  1. cyphos

    cyphos Guest

    Hi,

    I'm trying to display the data from my typed dataset on a page using
    the Xml web control.

    I have the following code:


    Xm1.Document = new XmlDataDocument(ds);


    Using the debugger, I found that the xml representation of my dataset
    looks like the following:

    [code:1:cd392f2d6e]
    <dsData>
    <Entry>
    <Title>Test</Title>
    <Description>This is a test</Description>
    </Entry>
    </dsData>
    [/code:1:cd392f2d6e]

    My xsl file looks like this

    [code:1:cd392f2d6e]
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <xsl:for-each select="dsData/Entry">
    <div class="Entry">
    <div class="EntryTitle">
    <xsl:value-of select="Title"/>
    </div>
    <div class="EntryDescription">
    <xsl:value-of select="Description"/>
    </div>
    </div>
    </xsl:for-each>
    </xsl:template>
    </xsl"stylesheet>
    [/code:1:cd392f2d6e]

    Using this stylesheet, nothing is displayed/transformed. I know that
    it must be a stylesheet problem because if I don't set the
    TransformSource property of the Xml control the raw xml of the
    dataset (XmlDataDocument) is displayed.

    I hope that someone understands this, as I'm lost.

    Thanks,
    Cyp.

    *-----------------------*
    Posted at:
    www.GroupSrv.com
    *-----------------------*
     
    cyphos, Dec 7, 2004
    #1
    1. Advertising

  2. cyphos

    Bryce Budd Guest

    Try

    <xsl:for-each select="//Entry">

    assuming dsData is your root node

    Regards,

    Bryce


    "cyphos" <-spam.invalid> wrote in message
    news:41b60c23$...
    > Hi,
    >
    > I'm trying to display the data from my typed dataset on a page using
    > the Xml web control.
    >
    > I have the following code:
    >
    >
    > Xm1.Document = new XmlDataDocument(ds);
    >
    >
    > Using the debugger, I found that the xml representation of my dataset
    > looks like the following:
    >
    > [code:1:cd392f2d6e]
    > <dsData>
    > <Entry>
    > <Title>Test</Title>
    > <Description>This is a test</Description>
    > </Entry>
    > </dsData>
    > [/code:1:cd392f2d6e]
    >
    > My xsl file looks like this
    >
    > [code:1:cd392f2d6e]
    > <?xml version="1.0" encoding="ISO-8859-1"?>
    > <xsl:stylesheet version="1.0"
    > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    > <xsl:template match="/">
    > <xsl:for-each select="dsData/Entry">
    > <div class="Entry">
    > <div class="EntryTitle">
    > <xsl:value-of select="Title"/>
    > </div>
    > <div class="EntryDescription">
    > <xsl:value-of select="Description"/>
    > </div>
    > </div>
    > </xsl:for-each>
    > </xsl:template>
    > </xsl"stylesheet>
    > [/code:1:cd392f2d6e]
    >
    > Using this stylesheet, nothing is displayed/transformed. I know that
    > it must be a stylesheet problem because if I don't set the
    > TransformSource property of the Xml control the raw xml of the
    > dataset (XmlDataDocument) is displayed.
    >
    > I hope that someone understands this, as I'm lost.
    >
    > Thanks,
    > Cyp.
    >
    > *-----------------------*
    > Posted at:
    > www.GroupSrv.com
    > *-----------------------*
     
    Bryce Budd, Dec 7, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. pete

    Xpath problem - yikes!

    pete, Dec 7, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    290
  2. PinoyDotnet
    Replies:
    2
    Views:
    927
    Brock Allen
    Apr 15, 2005
  3. James Woody

    Yikes. A little help here.

    James Woody, Feb 4, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    389
    James Woody
    Feb 6, 2006
  4. bjaramil
    Replies:
    0
    Views:
    383
    bjaramil
    Sep 15, 2004
  5. Skip Montanaro
    Replies:
    1
    Views:
    270
    Michele Simionato
    Jul 15, 2004
Loading...

Share This Page