p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 (http://p2p.wrox.com/forumdisplay.php?f=398)
-   -   Fetching the values from XML file (http://p2p.wrox.com/showthread.php?t=78691)

dhrumil March 25th, 2010 12:37 AM

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

mhkay March 25th, 2010 05:00 AM

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.

dhrumil March 29th, 2010 02:45 PM

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

mhkay March 29th, 2010 02:55 PM

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.

dhrumil March 29th, 2010 03:04 PM

Okie sir, thanks for your guidance..

chroniclemaster1 March 30th, 2010 07:52 PM

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


All times are GMT -4. The time now is 03:56 PM.

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