Subject: Re: [xsl] java filtering and xs From: "Ritu" <rkama@xxxxxxxxxxx> Date: Fri, 21 Feb 2003 09:48:16 -0600 |
I think what you want to do is to run 3 stylesheets in sequence. The output of first is the input for second and so on. You can do this by using pipelining. See the Pipe example in Xalan distribution. http://xml.apache.org/xalan-j/samples.html#pipe Ritu Kama Sarvega Inc 745, McLintock Dr Burr Ridge IL - 60527 ----- Original Message ----- From: "jandra x" <jandra_7@xxxxxxxxxxx> To: <XSL-List@xxxxxxxxxxxxxxxxxxxxxx> Sent: Friday, February 21, 2003 8:30 AM Subject: [xsl] java filtering and xs > > Hello again!!!I still have problems with my project. I can find a way to > combine dynamically three stylesheets one after the other in order to have > one smaller output. Please how can i do this with java??? Do I have to use > ant? > My original xml document includes clients from different countries.At first > i want to create anew xml doc which will have onlyclients from USA and then > a new xml doc which will have only those from ny. Assume that USA=1 and > ny=11(all the other countries have different numbers..) > > For example this is a part from my original xml: > > <client> > <fname>george</name> > <lastname>qwerty</lastname> > <address>1</address> > <region>12</region> > <email>hotmail</email> > <phone>200897456</phone> > </client> > > <client> > <fname>george</name> > <lastname>liberty</lastname> > <address>1</address> > <region>14</region> > <email>hotmail</email> > <phone>20084457456</phone> > </client> > > <client> > <fname>nick</name> > <lastname>klipd</lastname> > <address>1</address> > <region>19</region> > <email>hotmail</email> > <phone>200855</phone> > </client> > > <client> > <fname>alex</name> > <lastname>poly</lastname> > <address>1</address> > <region>11</region> > <email>hotmail</email> > <phone>20013131</phone> > </client> > > <client> > <fname>owen</name> > <lastname>nitro</lastname> > <address>7</address> > <region>71</region> > <email>yahoo</email> > <phone>8003698</phone> > </client> > > <client> > <fname>what</name> > <lastname>who</lastname> > <address>7</address> > <region>78</region> > <email>yahoo</email> > <phone>98</phone> > </client> > > <client> > <fname>owen</name> > <lastname>bishop</lastname> > <address>7</address> > <region>76</region> > <email>yahoo</email> > <phone>800</phone> > </client> > etc.... > > So with my first xsl i wnat to create this sort of xml > <?xml version="1.0" encoding="ISO-8859-1"?> > <?xml-stylesheet type="text/xsl" href="8.xsl"?> > <wow> > <client> > <fname>george</name> > <lastname>qwerty</lastname> > <address>1</address> > <region>12</region> > <email>hotmail</email> > <phone>200897456</phone> > </client> > > <client> > <fname>george</name> > <lastname>liberty</lastname> > <address>1</address> > <region>14</region> > <email>hotmail</email> > <phone>20084457456</phone> > </client> > > <client> > <fname>nick</name> > <lastname>klipd</lastname> > <address>1</address> > <region>19</region> > <email>hotmail</email> > <phone>200855</phone> > </client> > > <client> > <fname>alex</name> > <lastname>poly</lastname> > <address>1</address> > <region>11</region> > <email>hotmail</email> > <phone>20013131</phone> > </client> > </wow> > > and then with the second xsl this xml: > > <?xml version="1.0" encoding="ISO-8859-1"?> > <?xml-stylesheet type="text/xsl" href="8.xsl"?> > <wow> > <client> > <fname>alex</name> > <lastname>poly</lastname> > <address>1</address> > <region>11</region> > <email>hotmail</email> > <phone>20013131</phone> > </client> > </wow> > .... > > what i cant achieve is to cobine the two xsl files.import or include dont > seem to work. i use if to take only the clients from usa and then copy-of > select to create the new tree with them and then in the different xsl the > same idea to take the nyorkers. > The code is something like this: > > <xsl:stylesheet > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> > <xsl:output method="xml" indent="yes"/> > <xsl:template match="/"> > <xsl:apply-templates/> > </xsl:template> > <xsl:template match="clients"> > <xsl:if test="address='1'"> > <xsl:element name="client"> > <xsl:element name="fname"><xsl:copy-of select="./fname"/></xsl:element> > <xsl:element name="lastname"><xsl:copy-of > select="./lastname"/></xsl:element> > <xsl:element name="address"><xsl:copy-of > select="./address"/></xsl:element> > <xsl:element name="region"><xsl:copy-of > select="./region"/></xsl:element> > <xsl:element name="email"><xsl:copy-of select="./email"/></xsl:element> > <xsl:element name="phone"><xsl:copy-of select="./phone"/></xsl:element> > </xsl:element> > </xsl:if> > </xsl:template> > </xsl:stylesheet> > > > > > > > > _________________________________________________________________ > Tired of spam? Get advanced junk mail protection with MSN 8. > http://join.msn.com/?page=features/junkmail > > > 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] java filtering and xs, jandra x | Thread | [xsl] Stylesheets to render stylesh, Karl Stubsjoen |
[xsl] continuation - xalan2.4.1 on , TP | Date | RE: [xsl] Order of processing templ, Pilarski,James |
Month |