RE: [xsl] using different xsl based on xml

Subject: RE: [xsl] using different xsl based on xml
From: Robert Seber <robert.seber@xxxxxxxxxxxxxxxxxx>
Date: Wed, 2 May 2001 15:56:38 +0100
I would worry about it!

The best way would be to do some server-side coding to choose which
stylesheet to apply, depending on where the file comes from.  My suggestion
only makes sense if you don't have that option, and need to do all the
coding in the XSL.

> -----Original Message-----
> From: John Wang [mailto:jwang@xxxxxxxxxxx]
> Sent: Wednesday, May 02, 2001 3:37 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: [xsl] using different xsl based on xml
> 
> 
> Thanks for the reply.
> 
> There is one thing that I am worrying a lot. If the number of 
> my customer
> growing
> I have to mess with same XSL again and again to meet new 
> element. It will
> end up
> with very complicated xsl that hard to maintain.
> 
> Shall I worry about this?
> 
> -John
> 
> 
> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of 
> Robert Seber
> Sent: Wednesday, May 02, 2001 3:26 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: [xsl] using different xsl based on xml
> 
> You could have a single generic stylesheet with lots of sub 
> templates.  You
> could then perform the transformation and the XSL will match 
> to the elements
> available in the incoming XML e.g.
> 
> 1) <xsl:template match="/root">
>    ....
> 
> 2) <xsl:template match="/data">
>    ....
> 
> 1 would match a root element called "root" and 2 would match 
> a root element
> called "data".  Each one could treat the XML differently.
> 
> The precise solution depends on the XML you're receiving.  If 
> they share the
> same name for elements you may need to increase the complexity of the
> 'select's and 'match'es.
> 
> 
> > -----Original Message-----
> > From: John Wang [mailto:jwang@xxxxxxxxxxx]
> > Sent: Tuesday, May 01, 2001 8:25 PM
> > To: list
> > Subject: [xsl] using different xsl based on xml
> >
> >
> > Hello, All
> >
> > I got different xml data from different customers. What I am
> > trying to do is
> > convert the coming xml to my common xml, and use the common
> > one to send
> > data to my database.
> >
> > My question is, how can I tell where the xml comes from, 
> and how can I
> > determined
> > which xsl I should use to deal with the xml, without adding
> > anything in
> > customer's xml?
> >
> > Here I suppose at first time I got the xml, I made specific
> > xsl fot the xml.
> > so the xsl exists.
> >
> > Thanks in advance.
> >
> > -John
> >
> >
> >
> >  XSL-List info and archive:  
> http://www.mulberrytech.com/xsl/xsl-list
> >
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

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


Current Thread