Xpath problems #2

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:877c35039f]
<dsData>
 <Entry>
  <Title>Test</Title>
  <Description>This is a test</Description>
 </Entry>
</dsData>
[/code:1:877c35039f]

My xsl file looks like this

[code:1:877c35039f]
<?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:877c35039f]

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
*-----------------------*
0
12/7/2004 8:01:50 PM
dotnet.xml 7266 articles. 0 followers. Follow

5 Replies
611 Views

Similar Articles

[PageSpeed] 43

mweichert@wightman-dot-ca.no-spam.invalid (cyphos) wrote in news:41b60c2e$1
_4@Usenet.com:

> My xsl file looks like this
> 
> [code:1:877c35039f]
> <?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:877c35039f]
> 

Here's the line with the problem:
<xsl:for-each select="dsData/Entry">

Change your XPath to either "/dsData/Entry" or (my preference) "Entry".

-ivan.
0
news4694 (2)
12/8/2004 1:02:33 AM
Hi,

Thanks for the reply, but unfortunately it didn't solve the problem -
I still don't get any output from the transformation.

Regards,
Cyp.

*-----------------------*
        Posted at:
  www.GroupSrv.com
*-----------------------*
0
12/8/2004 3:57:23 AM
cyphos wrote:
> 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:877c35039f]
> <dsData>
>  <Entry>
>   <Title>Test</Title>
>   <Description>This is a test</Description>
>  </Entry>
> </dsData>
> [/code:1:877c35039f]
> 
> My xsl file looks like this
> 
> [code:1:877c35039f]
> <?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:877c35039f]
> 
> 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
> *-----------------------*


Are you using catch/try blocks or something? When I try exactly what 
you've posted, I get errors on load. But when I removed the 
[code:1:877c35039f] blocks, I had no issues with the translation.

Lowell

0
lowell1 (2)
12/8/2004 6:09:39 AM
Hi Lowell,

I'm using the following code in my page load event:


da.Fill(ds);
Xml1.Document = new XmlDataDocument(ds);


Other than that, the page is pretty simple - with just some content
and some data controls (SqlConnection, SqlDataAdapter, and DataSet
objects). What exactly did you remove to get it to work?

Thanks,
Cyp.

*-----------------------*
        Posted at:
  www.GroupSrv.com
*-----------------------*
0
12/8/2004 12:02:59 PM
Strange, but I got it work. I deleted the dataset, and created a new
one. However, this time I didn't create a typed dataset - and it
worked. I wonder how come it didn't work with a typed dataset?

Anyhow,
This leds to another XPath question, since the structure of my xml
changes.

I have the following xml:

<dsData>
 <Entry>
  <EntryID>10</EntryID>
  <Title>Testing an entry</Title>
 </Entry>
 <Comment>
  <CommentID>1</CommentID>
  <EntryID>10</EntryID>
 </Comment>
</dsData>


When I'm in a for-each loop that's selecting all Entry elements, I
want to display the total number of Comment elements that have the
current Entry's EntryID.

I have the following, but doesn't work:

[code:1:d4aa569951]
<xsl:for-each select="dsData/Entry">
  <!-- other content goes here -->
 <value-of select="count(/Comment[EntryID =
{EntryID}])"/>
</xsl:for-each>
[/code:1:d4aa569951]

Thanks!!!!
Cyp.

*-----------------------*
        Posted at:
  www.GroupSrv.com
*-----------------------*
0
12/8/2004 12:57:12 PM
Reply:

Similar Artilces:

EXCEL 2000 problem
I am having an intermittent problem with EXCEL 2000. Normally I can drag a formula across several columns and it will produce the correct answer for each column. Currently, when I drag the formula across, although the formula appears to be correct, the same total appears in every column, regardless of the content of the column.The total is the same as the column from where I dragged the formula. Also, if I change a column entry, the total will not update. This is causing some concern as I have to manully enter every formula and after I change an entry, I have to manuall repeat the ...

Outlook Folders #2
The main folders that come with the program are an integral part of th program, but unfortunately they delete very easily and without "are yo sure" warning. I want to recover the CONTACTS FOLDER and ONE OF TH THREE EXTRA CALENDAR VIEWS. This is not a simple issue, so I am hopin that someone happen to have a solution Go Campin ----------------------------------------------------------------------- Posted via http://www.mcse.m ----------------------------------------------------------------------- View this thread: http://www.mcse.ms/message325935.htm I'm not sure what you ...

1.2 Integration and GP 7.5
Does 1.2 CRM Integration work with Great Plains 7.5? The Integration install guide says 7.0, but I would assume it would work with the latest version of GP. -- Brandon IT Director Presentations Direct - Office Equipment & Supplies http://www.presentationsdirect.com Where did you get hold of the 1.2 Integration appliication? I can only see 1.0 Integration avail at the moment Regards J "Brandon S." <bsmith@presentationsdirect.nospam.com> wrote in message news:#Cj4Xnf4DHA.1752@tk2msftngp13.phx.gbl... > Does 1.2 CRM Integration work with Great Plains 7.5? The Inte...

Stacked bar and lines on 2 axes
Is it possible to create a chart that has stacked bars on one axis (e.g. values between 0 and 10) and have lines relating to the second axis (e.g values between 0 and 30,000)? I have 4 series each for the stacked bar and lines. On Tue, 26 Jun 2007, in microsoft.public.excel.charting, richb <richb@discussions.microsoft.com> said: >Is it possible to create a chart that has stacked bars on one axis (e.g. >values between 0 and 10) and have lines relating to the second axis (e.g >values between 0 and 30,000)? I have 4 series each for the stacked bar and >lines. Yes. Ignore ...

Junk mail filter instillation problem
The operating system is Windows XP Home with all the Microsoft updates. The office program also is current, with one major exception. I bought a copy of Outlook 2003 some time a ago, and installed it in place of Outlook 2002. I have been unsuccessful in attempting to install over and over again the recently released December 2005 junk mail filter update. I even shut down the Kaspersky anti-virus and the Outpost firewall in some of my attempts to install this update. How do I install this latest junk mail filter. Thanks ...

keyboard shortcuts problem
Certain keyboard shortcuts have stopped working in my Excel 2003. CTRL+X, CTRL+C, and CTRL+V no longer work. They still work from the toolbar menu or when right clicking. Other shortcuts like CTRL+A and CTRL+Z still work. Does anyone have any ideas? -- carloscuderia ------------------------------------------------------------------------ carloscuderia's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=34503 View this thread: http://www.excelforum.com/showthread.php?threadid=542700 Do those shortcut keys work in other applications? If yes, maybe you have a ...

M2004 (No MSN, no Passport) -> M2006 Any problems?
I use M2004 without MSN, Passport or passwords. My financial institutions (Citi cards, Fidelity, Bank One) download into M2004 without any problems. Will I be able to transition into M2006 without any problems? I'll be happy to maintain the current M2004 features and capabilities. I'm thinking of M2006 only because the on-line stuff for M2004 will expire next year. -- Aloke ---- to reply by e-mail remove 123 and change invalid to com In microsoft.public.money, Aloke Prasad wrote: >I use M2004 without MSN, Passport or passwords. My financial institutions >(Citi card...

Problem with Outlook 2003 w/BCM
In Outlook you are able to type names into the To: list and go about your business. All of a sudden I can type the names in or the distribution list name but it won't allow me to send the email saying it has a problem with the parameters. If I select the name or DL name from the actual address book it works fine. Anyone else had this problem or know what might be causing the problem. It's on a XP Pro laptop. Thanks in advance. JD Try this: Close Outlook Search for a file with an NK2 extension. It should be in C:\Documents and Settings\Application Data\Microsoft\Outlook Renam...

Italics problem
I notice when I go to format cells, if I switch to italic bold bold italic Then it is impossible to switch back to "Regular". "Regular" does not seem to be an option. Help, everything is in italics!! ...

XPath
Using XPath I am querying parts of XML document, " get quoted by \ - is it possible to specify not to quote " with \? <RootElement> <Element Attribute="SomeValue" /> </RootElement> XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(fileName); XmlNode xmlNode = xmlDoc.SelectSingleNode("//RootElement/Element") Print xmlNode.OuterXml <Element Attribute=\"SomeValue\"/> where I was expecting to get <Element Attribute="SomeValue"/> TIA Dennis wrote: > Using XPath I am querying parts of XML document,...

editing rules #2
This question applies (in this case) to Outlook 2000. Let's say you have a rule that would move mail from a list of addresses, like all of your travel web sites to a folder named Travel. Then you sign up with another site and you want to add them to this rule. How can you do it without adding them to your contacts list? How can you create one rule that applies to multiple e-mail addresses like that? ...

Problems with clicking in a tree ctrl.
Hello! Strange thing here. I tried to click at the plus sign in a tree, but I can't receive the selected item. why? -- - Lars ...

Can I import a Lotus 1-2-3 spreadsheet into Excel and save all fo.
I would like to import a 1-2-3 spreadsheet that contains many formulas. It would be really great if the formulas were understood by Excel and preserved during the import. Is this possible? I think it depends on your versions. I use Excel XP (2002) and when I file/Open, I get a choice of file types, including an option to select "Lotus 1-2-3 (*.wk?)" file type. I think Lotus superseded that with *.123 file types (and for all I know they may have moved on from that ... it has been a while). Lotus also has an option to save a file as .xls or .xlw file type, but again depending on...

Problem Converting from Money 2003 to 2007
Hi everyone. We have been using Money 2003 Deluxe (V. 11) for several years, and have been with Money even prior to that. After several notifications that our version is no longer being supported, we have decided to move to the newest version, Money 2008 Plus Deluxe. Both are the US versions of the software. The 2003 has been running on a number of XP systems, and one Vista PC. As context, we consider ourselves relatively advanced users. We're relatively competent with PCs, as well accounting software. We move data around all the time, and know how to back it up. We have a large f...

delegate problems
If I'm a delegate for someone and I have his inbox and I go and delete something it goes to my delete folder not his. Is there a way to setup a rule or something so when I delete something from his in box it would show up in his delete folder. ...

Getting a specific parent of any node via xpath navigation
I am storing my site structure as such: <menuItems> <menuItem> <pageID>1</pageID> </menuItem> <menuItem> <pageID>2</pageID> <menuItem> <pageID>4</pageID> <menuItem> <pageID>5</pageID> <menuItem> <pageID>6</pageID> </menuItem> </menuItem> </menuItem> </menuItem> <menuItem> <pageID>3</pageID> ...

Strange Message in Header and red x problem
My continuing Saga of the red x's. When an E-mail (that has http tags in it that will show as red x's when read) arrives into Outlook 2007 (with Vista Ultimate OS and Office Pro 2007 installed)), the header in the top pane first shows the message : "You have received an HTML E- Mail from sendersname, but it appears that your E-Mail client is set to read messages in plain text" Well, my client is NOT set to do that (or anywhere I can see) and after you hover over the message with the mouse, that header disappears and it shows just the subject line. Does that help anyone tow...

Muliple Charts from one Pivot Table #2
Debra, many thanks for that but I was looking for a more automated way. Ther are over 600 stores. Is there a vb code way in doing this? Best regards Ton -- TJonesEs ----------------------------------------------------------------------- TJonesEsq's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1532 View this thread: http://www.excelforum.com/showthread.php?threadid=26951 If you want to print a copy of the chart for each store, you could use code similar to the following: Sub PrintPivotCharts() 'prints a chart for each item in the page field Dim pt A...

problems in HQ
Hi, I have a multitore scenario....... one of my stores are showing a batch being opened and closed, but at my Head Office i am not seeing that batch in HQ. If anyone else had this problem please send me the solution. Thanks. -- Kay Hi Kay - try creating a 401 worksheet, backdate it a day or two before the date of the batch at the store and connect with your store - this should bring in the batch into HQ...hope this helps. "Kay" wrote: > Hi, > I have a multitore scenario....... one of my stores are showing a batch > being opened and closed, but at my Head Office i...

printing formulas #2
I am trying to print the formulas that I created in a worksheet. Does anyone know how to do that? Alfonso, Flip to formula view (Ctrl-` - left next toe the keyboard numbers), and then just print it. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Alfonso" <anonymous@discussions.microsoft.com> wrote in message news:9E94F456-31DC-4C50-9643-5C5AFA95E95E@microsoft.com... > I am trying to print the formulas that I created in a worksheet. Does anyone know how to do that? Bob, Which ...

email delivery problem
Hi, Since upgrading to a new DSL line we started to recieve complaints from users that email to aol and a number of other addresses were not being delivered. Further investigation found that aol was rejecting our ip address because it deemed it to be dynamic - this is not the case as we paid for a static allocation. We have contacted our isp and they confirm that the addresses are static but were part of a dynamic allocation thus explaining why aol and others are blocking email. They suggested relaying mail through one of their mail servers, however I have been unable to find where this ca...

Money 2004
I have multiple accounts at Fidelity (Brokerage, 401(k), IRAs, UTMA) in my and my spouse's name. My problem is that Money 2004 inexplicably stops downloading transactions from the Fidelity accounts. It will still update online quotes, and credit card transactions from Discover. The only way I can download Fidelity transactions is to go to the Online Service Manager and discontinue using the service, and then go back to setup service. This becomes a pain when you have to do it every two weeks and then you have to match each account in Money with the corresponding Fidelity accou...

Installation problem 06-04-07
I am trying to install CRM from the 90day demo provided with "Working with Microsoft Dynamics CRM 3.0" and get the followin message:- Microsoft CRM 3.0 Server Setup Action Microsoft.Crm.Setup.Common.Analyzer+CollectAction failed, The specified domain either does not exist or could not be contacted. with Abort/Retry/Ignore buttons I am completely new to CRM so this may be obvious - but not to me... Guy Hi Does the server you are using to install CRM on belong to the domain that you are using? Does the install user account have rights to the domain? -- Rgds Michael MCDB...

Same problem can send mail but cant recieve none of the threads he
My problem is basiclly the same but i tried all that and it didnt help im tryign to make my windowmail read my live account and it will recieve email but not send or forward here is my error code The connection to the server has failed. Subject 'test', Account: 'pop3.live.com', Server: 'smtp.live.com', Protocol: SMTP, Port: 25, Secure(SSL): Yes, Socket Error: 10060, Error Number: 0x800CCC0E Try these - compare against the settings you currently have in Tools - Accounts - Properties for that account. Live.com Settings: Server names and ports: POP3 ...

data range problem
Hi I have a problem with external data. In the Data Range Properties, under Data Layout. There are 3 options after 'If the number of rows in the data range changes upon refresh:' 1 - Insert cells for new data, delete unused cells 2 - Insert entire rows for new data, clear unused cells 3 - Overwrite existing cells with new data, clear unused cells. I want option 3 to be the default oprion but it always defaults back to option 2. Is there any way I can change this.?? Cheers Baz ...