Re: Standard in creatring xml files

2003-01-22 Thread Jeff Turner
On Wed, Jan 22, 2003 at 02:11:05PM +0330, Alireza Fattahi wrote:
 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
   nameAlireza/name
   familyFattahi/family
 /customer
 
 2)
 product
   brandIBM/brand
   price10,000/price
 /product
 
 We should create 2 xsl files for parsing if there are 40 files we should
 create 40 file! Is it correct?

If you want 40 different kinds of output, then you need 40 XSLTs.  You
could probably make just a few and parametrize them.

If you want just a few output formats, you can have intermediate adaptor
stylesheets converting a common XML 'searchresults' format.

 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?

RDF is nice and generic.  I've used DSML (LDAP searchresult XML format)
before.  Also, you could reuse the Google search result XML format.  See
http://www.google.com/apis/


--Jeff

 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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




RE: Standard in creatring xml files

2003-01-22 Thread Luca Morandini
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
nameAlireza/name
familyFattahi/family
/customer
or
product
brandIBM/brand
price10,000/price
/product

Will become:
row
columnAlireza/column
columnFattahi/column
/row
or
row
columnIBM/column
column10,000/column
/row

And then they will become:
tr
tdAlireza/td
tdFattahi/td
/tr
or
tr
tdIBMtd
td10,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
nameAlireza/name
familyFattahi/family
/customer
or
product
brandIBM/brand
price10,000/price
/product

Will directly become:
tr
tdAlireza/td
tdFattahi/td
/tr
or
tr
tdIBMtd
td10,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
  [EMAIL PROTECTED]
http://utenti.tripod.it/lmorandini/index.html
-


 -Original Message-
 From: Alireza Fattahi [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 22, 2003 11:41 AM
 To: '[EMAIL PROTECTED]'
 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
   nameAlireza/name
   familyFattahi/family
 /customer

 2)
 product
   brandIBM/brand
   price10,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: [EMAIL PROTECTED]
 For additional commands, e-mail:   [EMAIL PROTECTED]



-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]