xsl-list
[Top] [All Lists]

Re: to find all childrens for a parent

2003-09-03 15:38:47
Laxman,

Assume your user selects a value you call 'server', which you pass into your XSL transformation as a run-time parameter matching the value of your attribute "server_id".

Given the input you have provided, and assuming DATA is your document element, the printers associated with the particular server will be returned by the XPath expression:

/DATA/Server[(_at_)server_id=$server]/Printer

Select these nodes in an apply-templates instruction and match them with a template to generate, for each of them, the HTML you need (<select> elements or whatever).

If you need us to be more specific, give us some sample output you would like to see. (I dare say, however, once you do that you'll discover your real problem: designing the HTML. This looks like a Javascript/VB question, not strictly an XSLT one.)

Cheers,
Wendell

 At 05:23 PM 9/3/2003, you wrote:
Hi,
 I am fairly new to XML and XSL. I have a question for
the forum. I would greatly
appreciate if someone can help me out.

Below is the xml file.

<DATA>
  <Server server_id="s1" server_desc="abc">
   <Printer printer_id="p1" printer_desc="P1">
   <Printer printer_id="p2" printer_desc="P2">
   <Printer printer_id="p3" printer_desc="P3">
  </Server>
  <Server server_id="s2" server_desc="efg">
   <Printer printer_id="p4" printer_desc="P4">
   <Printer printer_id="p5" printer_desc="P5">
   <Printer printer_id="p6" printer_desc="P6">
  </Server>
</DATA>

I am tryring to build HTML <select> tag to show only
printers associated with that server when the user
select the server from the drop down box.
Can you please help me in providing the XSL.

Thanks in advance for your help.
Laxman Sanyasi


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>