XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 17th, 2004, 09:42 AM
ssrini03 ssrini03 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 7 ssrini03 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
XSL Help...URGENT ! Pls help

I am using following code to read from a xml document which is located in the same folder as this xsl file. This gives an error. Can you tell me whats wrong with this ?

<xsl:for-each select="document('cc_ins_entitle_customer_scroller.xml')/Customers/Customer">
.....
<td class="readonly_grid_cell" width="130" id="CustName" name="cust" onclick="showItem(this.innerText)">
<xsl:value-of select="Name"/>
</td>
.....
</xsl:for-each>

the xml file content is:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="cc_ins_entitle_customer_scroller.xsl"?>
<Customers>
<Customer>
<Name>C1</Name><Address>100 Mayland Dr</Address>
<City>Horsham</City>
<Zip>01110</Zip>
<State>PA</State>
<Phone>2126279172</Phone>
<Item>
<Class>101</Class>
<Brand>SON</Brand>
<Model>TV2356</Model>
<Purchase>1/1/1995</Purchase>
<Warranty>ESP</Warranty>
<ContractNo>101</ContractNo>
</Item>
</Customer>
<Customer>
<Name>C2</Name><Address>240 Horsham Rd</Address>
<City>Horsham</City>
<Zip>11111</Zip>
<State>VA</State>
<Phone>2126279172</Phone>
<Item>
<Class>201</Class>
<Brand>RCA</Brand>
<Model>RD2356</Model>
<Purchase>1/1/1997</Purchase>
<Warranty>MFG</Warranty>
<ContractNo>201</ContractNo>
</Item>
</Customer>
</Customers>

Reply With Quote
  #2  
Old June 17th, 2004, 10:01 AM
wendra wendra is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: Germany
Posts: 14 wendra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by ssrini03
<xsl:for-each select="document('cc_ins_entitle_customer_scroller.xml')/Customers/Customer">

I think this is the problem. Try
Code:
<xsl:for-each select="Customers/Customer">

Reply With Quote
  #3  
Old June 17th, 2004, 10:27 AM
ssrini03 ssrini03 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 7 ssrini03 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This did not work.
However, <xsl:for-each select="root/row"> works fine. So I am assuming it is trying to read from some other XML document. How do I make it read from MY XML document ?

Reply With Quote
  #4  
Old June 17th, 2004, 10:33 AM
wendra wendra is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: Germany
Posts: 14 wendra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
So, it doesn't? Can you attach the files, so I can have a deep look at it? And also tell me how should it work.

Reply With Quote
  #5  
Old June 17th, 2004, 10:49 AM
ssrini03 ssrini03 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 7 ssrini03 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
attachment

attached are the xsl and xml files.
Find "cc_ins_entitle_customer_scroller" in the xsl file. Thats the code I am having problems with.

<xsl:for-each select="Customers/Customer"> does not work here.
Attached Files
File Type: zip files.zip (3.1 KB, 207 views)

Reply With Quote
  #6  
Old June 17th, 2004, 03:45 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,569 jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 22 h 42 m 51 sec
Reputation Power: 835
ssrini03

Please read "How to post a question!" (link in sig) before posting again. Your thread subject needs to describe your problem. You are in the XSL forum, we know you need XSL help. Also, please place code in tags so it's easier for everybody to read.
__________________
# Jeremy

Explain your problem instead of asking how to do what you decided was the solution.

Reply With Quote
  #7  
Old June 18th, 2004, 08:51 AM
wendra wendra is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: Germany
Posts: 14 wendra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ssrini03, sorry I have so much of my time occupied by my current task, so I can not do this. I am very sorry for the inconvenience. But I do have tried your XML and XSL, and I have something in mind. Perhaps:
Code:
<xsl:for-each select="ancestor:Customers/Customer">

would do something, but I am not very sure about it. And now I have to go back to my task. I am very sorry.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XSL Help...URGENT ! Pls help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT