[
Lists Home |
Date Index |
Thread Index
]
- From: taherkordy@dpi2.dpi.net.ir
- To: xml-dev@lists.xml.org
- Date: Fri, 04 Jun 1999 10:42:56 +0330
Hi,
I have some problems in writing XSL stylesheets.
Suppose we have the following XML file(book.xml) that is
extracted from the Book Table:
<?xml version="1.0"?>
<book>
<title> Computer Networks </title>
<category_id> 2 </category_id>
...
</book>
I also have a Parameters table and have extracted values
for "category" parameter as follows(parameter.xml):
<?xml version="1.0"?>
<parameter>
<category>
<category_item id="1">Art</category_item>
<category_item id="2">Computer</category_item>
<category_item id="3">Physics</category_item>
..
</category>
</parameter>
I want to have the following Html file as the result of
merging two XML files and an XSL file(what that I want to help me):
<html>
<body>
Title :
<INPUT TYPE='text' NAME='txtTitle' VALUE="Computer Networks" >
Category:
<SELECT NAME="category" SIZE=1>
<OPTION value='1'>Art
<OPTION value='2' SELECTED>Computer
<OPTION value='3'>Physics
</SELECT>
</body>
</html>
I have two quietions :
1. I think that when reading from Book and Parameter
table, I should make an XML file that have information about
books and categrory parameters togother.
Such as following XML:
<?xml version="1.0"?>
<book>
<title> Computer Networks </title>
<category>
<category_item >
<description>Art</description>
<id>1</id>
<selected>false</selected>
</category item>
<category_item >
<description>Computer</description>
<id>2</id>
<selected>true</selected>
</category item>
<category_item >
<description>Physics</description>
<id>3</id>
<selected>false</selected>
</category item>
</category>
...
</book>
I want to know that Is it right this idea ?
2. I want to write an XSL stylesheet for producing this HTML file
that automatically selects "computer" option in category Combobox
based on value of "category_id" in book.xml and "id"
attribute in parameter.xml
Could you please help me for writing this XSL ,
I'm new to XSL ? (I use LotusXSL parser)
Best Regards,
Taherkordy@dpi2.dpi.net.ir
|