Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: using xsl file to parse out a chunk of XML >Thread Next - Re: using xsl file to parse out a chunk of XML Re: using xsl file to parse out a chunk of XMLTo: NULL Date: 1/7/2009 10:09:00 AM On Jan 7, 12:26=A0pm, Martin Honnen <mahotr...@yahoo.de> wrote: > paul_0...@yahoo.com wrote: > > this is the version of xsltproc I am using so what ever will work this > > this. > > libxslt is XSLT 1.0. But if all of those params are provided then XSLT > 2.0 is not needed I think: > > =A0 =A0<xsl:param name=3D"id"/> > > =A0 =A0<xsl:param name=3D"pid"/> > > =A0 =A0<xsl:param name=3D"tid"/> > > =A0 =A0<xsl:template match=3D"/"> > =A0 =A0 <xsl:copy-of > =A0 =A0 =A0 select=3D"root/query[content =3D concat('id=3D', $id, ';pid= =3D', $pid, > ';tid=3D', $tid)]"/> > =A0 =A0</xsl:template> > > -- > > =A0 =A0 =A0 =A0 Martin Honnen > =A0 =A0 =A0 =A0http://JavaScript.FAQTs.com/ Sorry to bother you but this is what I have and it does not seem to be working. a.xsl <xsl:stylesheet xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform" version=3D"1.0"> <xsl:output method=3D"text"/> <xsl:strip-space elements=3D"*"/> <xsl:param name=3D"id" select =3D "'UNDEFINED'"/> <xsl:param name=3D"pid" select =3D "'UNDEFINED'"/> <xsl:param name=3D"tid" select =3D "'UNDEFINED'"/> <xsl:template match=3D"/"> <xsl:copy-of select=3D"root/query[content =3D concat('id=3D'= , $id, ';p d=3D', $pid, ';tid=3D', $tid)]"/> </xsl:template> </xsl:stylesheet> the single root element in my XML is <queries> <queries> <query id=3D"8124-1228816866" chunk=3D"0" desc=3D""> <context>id=3D1005;pid=3D5208;tid=3D5400</context> <a>111</a> <b>222</b> <c>333</c> </query> <query id=3D"8124-1228816867" chunk=3D"0" desc=3D""> <context>id=3D1006;pid=3D5278;tid=3D5400</context> <a>444</a> <b>555</ba> <c>666</c> </query> </queries> I am calling it like this: xsltproc --param id '1005' --param pid '5208' --param tid '5400' ./ a.xsl ./a.xml Am I missing something? | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
