This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Application using XML



=== daniel.newman@bis-web.net 04/03/01 01:23PM ===
>I'm planning on building an Internet application using XML. Now I'm going to
>need an ASP page that gets different XML results (that bit's easy), and also
>gets different XSL files to format the XML (that bit's easy also). BUT, if I
>want to have just one XSL file that interprets the source data and uses the
>relevant part of the XSL file. So if I have a maximum of 10 different result
>(xHTML) pages, can I have one XSL file building them?

Yes, so long as there is a mechanism for identifying the different types - be this different XML or parameters.

> Is it possible from
>the ASP page, to pass variables to the XSL file so it knows which page it's
>producing?

Probably - but you would need to check the ASP/XSLT integration documentation. The mechanism for passing parameters is undefined by the w3 - they simply provide support in XSLT for it to happen somehow. (<xsl:param ...> at the top level)

>If I need to have 10 XSL files, fine, but thought this might not be the best
>way of doing this. Although having all that extra code in the single XSL
>file might get confusing. What's the best way to go about planning this
>application?

Generally start by trying to modularise the code somehow. A lot depends upon the data itself - how similar is the XML? Are all the transforms going to behave similarly?  You may find that after you split the code up into sections that you can build 10 driver files which basically import/include other templates, or you may find that you still prefer to build 1 driver and then call the rest of the templates. I prefer the 10 drivers and then override-any-behaviour-of-the-core-modules-I-don't-like-in-the-driver file approach myself. Its simple, clean and makes variations obvious.

Alistair


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]