Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0
This is the forum to discuss the Wrox book XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition by Michael Kay; ISBN: 9780470192740
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 25th, 2010, 12:37 AM
Authorized User
 
Join Date: Mar 2010
Posts: 28
Thanks: 3
Thanked 0 Times in 0 Posts
Post Fetching the values from XML file

Respected sir,

I have different different file for a single XSL style-sheet. In that XML file on information is vary every time.

Now, I have to fetch this value in my style-sheet and accordingly that information is display in the browser.

In my XML file one value is Band Information. This value is different for different XML files.
I want to fetch this value. What should i do?

Please suggest.

Thanks,
Dhrumil Shah
Reply With Quote
  #2 (permalink)  
Old March 25th, 2010, 05:00 AM
mhkay's Avatar
Wrox Author
Points: 18,481, Level: 59
Points: 18,481, Level: 59 Points: 18,481, Level: 59 Points: 18,481, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,960
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Sorry, I don't understand your difficulty. What you are describing is what every XSLT user does. You're asking a question like "How do I write a program?".

Perhaps showing us what you have now and how it needs to be extended might be useful.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
Reply With Quote
  #3 (permalink)  
Old March 29th, 2010, 02:45 PM
Authorized User
 
Join Date: Mar 2010
Posts: 28
Thanks: 3
Thanked 0 Times in 0 Posts
Default Fetching the values from XML file

Respected Sir,

Here is my XML file.

<?xml version="1.0"?>
<?xml-stylesheet href='newCSS.XSL' type='text/xsl'?>
<Definition>
<sen_id> "LISS-3" </sen_id>
<pro_id> "L3ALWAR005" </pro_id>
<sub_id> " " </sub_id>
<orbit_no> "000000"</orbit_no>
<path_no> "095" </path_no>
<row_no> "052" </row_no>
<no_of_bands> "2" </no_of_bands>
<band_combi> "2345" </band_combi>
</Definition>

In this XML file you can see no_of_bands tag. This value is different in other XML file.

Now, I have one XSLT file. I am using that same XSLT file for all the XML files. But the problem is that the value of no_of_bands is different like some times is seems to be 3 or 4.

So my question is that how the XSLT file find how much no_of_bands it has to consider.

And my another question is that how can we put Recursive Loop (similar to for loop in C or C++) in the XSLT file for displaying values.

Regards/Thanks,
Dhrumil Shah
Reply With Quote
  #4 (permalink)  
Old March 29th, 2010, 02:55 PM
mhkay's Avatar
Wrox Author
Points: 18,481, Level: 59
Points: 18,481, Level: 59 Points: 18,481, Level: 59 Points: 18,481, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,960
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Sorry, I don't understand the problem. It's perfectly normal to use the same XSLT file with multiple XML files, and for the different XML files to have different content. Why is this a problem? (The problem is partly your English, I'm afraid: the sentence "So my question is that how the XSLT file find how much no_of_bands it has to consider." doesn't really make much sense.)

As for your other question, it would be better to ask it on a separate thread, and to illustrate what you want to achieve by showing the input XML and the desired output.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
Reply With Quote
  #5 (permalink)  
Old March 29th, 2010, 03:04 PM
Authorized User
 
Join Date: Mar 2010
Posts: 28
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Okie sir, thanks for your guidance..
Reply With Quote
  #6 (permalink)  
Old March 30th, 2010, 07:52 PM
Friend of Wrox
Points: 1,749, Level: 16
Points: 1,749, Level: 16 Points: 1,749, Level: 16 Points: 1,749, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

Your first question sounds really basic. Maybe if you show us what you want the output to be, we can be more helpful.
__________________
-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to avoid duplicate values from the xml file us balasundarrao XSLT 2 June 4th, 2014 11:56 PM
Fetching Form Values with ASP cancer10 Classic ASP Databases 1 March 15th, 2007 06:58 AM
problem fetching remote xml file method RSS and Atom 0 February 16th, 2007 07:50 PM
Fetching fields from flat file Jeff Moden SQL Server 2000 2 November 22nd, 2006 08:30 AM
Fetching fields from Flat File praveennk84 SQL Server 2000 14 November 22nd, 2006 01:13 AM



All times are GMT -4. The time now is 05:08 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.