cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luca Morandini" <luca.morandi...@tin.it>
Subject RE: Standard in creatring xml files
Date Wed, 22 Jan 2003 11:27:58 GMT
Alireza,

you can do it in a number of ways, as of now, a couple of those come to my mind:

1) Build an intermediate XSLT stage to transform the found elements in a common row/attributes
schema... later to be rendered in
HTML by a single XSLT
<customer>
 	<name>Alireza</name>
 	<family>Fattahi</family>
</customer>
or
<product>
 	<brand>IBM</brand>
 	<price>10,000</price>
</product>>

Will become:
<row>
	<column>Alireza</column>
	<column>Fattahi</column>
</row>
or
<row>
	<column>IBM</column>
	<column>10,000</column>
</row>

And then they will become:
<tr>
	<td>Alireza</td>
	<td>Fattahi</td>
</tr>
or
<tr>
	<td>IBMtd>
	<td>10,000</td>
</tr>

2) Build an XSLT which renders any root's children as rows of an HTML table (regardless the
name of such children) and any children
of them as single HTML columns
Hence:
<customer>
 	<name>Alireza</name>
 	<family>Fattahi</family>
</customer>
or
<product>
 	<brand>IBM</brand>
 	<price>10,000</price>
</product>

Will directly become:
<tr>
	<td>Alireza</td>
	<td>Fattahi</td>
</tr>
or
<tr>
	<td>IBMtd>
	<td>10,000</td>
</tr>

I'd prefer the first approach, since then you can re-use the "intermediate" schema for other
purposes.

Regards,

---------------------------------------------
               Luca Morandini
               GIS Consultant
              lmorandini@ieee.org
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------


> -----Original Message-----
> From: Alireza Fattahi [mailto:Alireza.Fattahi@pdpsoft.com]
> Sent: Wednesday, January 22, 2003 11:41 AM
> To: 'cocoon-users@xml.apache.org'
> Subject: Standard in creatring xml files
>
>
> Hi,
>
> We want to create a web site with 40 pages. The site has typical input forms
> and search/search result pages. We want to have some XSL files as the
> template for these pages. Of course we should not have 40 xsl files, but 40
> xml files. But, how?
>
> Here is an example:
> Suppose we have two search result pages that generate these xml files.
> 1)
> <customer>
> 	<name>Alireza</name>
> 	<family>Fattahi</family>
> </customer>
>
> 2)
> <product>
> 	<brand>IBM</brand>
> 	<price>10,000</price>
> </product>>
> We should create 2 xsl files for parsing if there are 40 files we should
> create 40 file! Is it correct?
>
> Is there any guideline that can help us creating a standard for these
> typical applications? What standards should be obeyed by (for example) a
> typical search result page?
>
> Alireza
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message