473,503 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Xpath problem - yikes!

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
*-----------------------*
Nov 19 '05 #1
1 1209
Try

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

assuming dsData is your root node

Regards,

Bryce
"cyphos" <mw*******@wightman-dot-ca.no-spam.invalid> wrote in message
news:41**********@Usenet.com...
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
*-----------------------*

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6812
by: bdinmstig | last post by:
I refined my attempt a little further, and the following code does seem to work, however it has 2 major problems: 1. Very limited support for XPath features Basic paths are supported for...
0
1903
by: gael.pegliasco | last post by:
Hi, How are you dear and nice helper :) ? I'm trying to test xpath with this simple program : import xml.dom.minidom from xml.xpath.Context import Context import xml.xpath
4
21185
by: Son KwonNam | last post by:
In XSLT, is this possible to get value from xml using XPath which is in XSLT variable? I mean XPath strings can be dynamic while XSL Transforming. If possible, How?? Because I'm not a...
5
4184
by: laks | last post by:
Hi I have the following xsl stmt. <xsl:for-each select="JOB_POSTINGS/JOB_POSTING \"> <xsl:sort select="JOB_TITLE" order="ascending"/> This works fine when I use it. But when using multiple...
0
251
by: pete | last post by:
Hi there, I've just tried the xml / xslt you provided in XmlSpy and it transformed correctly. Have you checked that your transformation code works correctly? Cheers Pete From: "cyphos"...
18
7702
by: jacksu | last post by:
I have a simple program to run xpath with xerces 1_2_7 XPathFactory factory = XPathFactory.newInstance(); XPath xPath = factory.newXPath(); XPathExpression xp = xPath.compile(strXpr);...
9
2126
by: David Thielen | last post by:
Hi; I am sure I am missing something here but I cannot figure it out. Below I have a program and I cannot figure out why the xpath selects that throw an exception fail. From what I know they...
5
7907
by: Gnic | last post by:
Hi , I have an XmlDocument instance, I want to find a node in the xml, but I don't know it's path until runtime, for example <aaa> <bbb name="x"/> <aaa attr="y"> <ccc>sometext</ccc> </aaa>
4
12732
by: Claudio Calboni | last post by:
Hello folks, I'm having some performance issues with the client-side part of my application. Basically, it renders a huge HTML table (about 20'000 cells in my testing scenario), without content....
0
7063
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7313
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7441
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5558
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3156
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3146
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
366
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.