Re: [xsl] to find all childrens for a parent

Subject: Re: [xsl] to find all childrens for a parent
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 03 Sep 2003 18:38:47 -0400

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:


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.)


At 05:23 PM 9/3/2003, you wrote:
 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.

  <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_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">

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@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.      
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:

Current Thread