Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: XSLT code >Thread Next - Re: XSLT code Re: XSLT codeTo: NULL Date: 6/6/2008 8:15:00 AM On Jun 6, 10:23=A0am, Martin Honnen <mahotr...@yahoo.de> wrote: > paul_0...@yahoo.com wrote: > >> =A0 =A0<xsl:template match=3D"ResponseFile[not(node())]"> > >> =A0 =A0 =A0<xsl:copy> > >> =A0 =A0 =A0 =A0<xsl:value-of select=3D"$response_file"/> > >> =A0 =A0 =A0</xsl:copy> > >> =A0 =A0</xsl:template> > > Note the elments are a bit different since there is an attrtibute > > "Mode" in the ResponseFile element > > as there is no attribute in the StatusFile element. > > > =A0<?xml version=3D"1.0" encoding=3D"UTF-8"?> > > =A0<CentralServerRequest> > > =A0 =A0 =A0<RequestInfo> > > =A0 =A0 =A0 =A0 =A0<ResponseFile Mode=3D"Overwrite"></ResponseFile> > > If you want to copy the attribute use > > =A0 =A0<xsl:template match=3D"ResponseFile[not(node())]"> > =A0 =A0 =A0<xsl:copy> > =A0 =A0 =A0 =A0<xsl:apply-templates select=3D"@*"/> > =A0 =A0 =A0 =A0<xsl:value-of select=3D"$response_file"/> > =A0 =A0 =A0</xsl:copy> > =A0 =A0</xsl:template> > > > Based on that, I am assumming the XSLT code has to look a bit > > different when doing the match? Is there some sytnax to specify the > > atttibute name in the matc?. It would be okay with matching > > "ResponseFile Mode" and skipping the value =A0"OverWrite" since my Mode > > can have several different > > values that I may want to ignore. > > If you want to add the text if the Mode attribute exists then use > > =A0 =A0<xsl:template match=3D"ResponseFile[@Mode and not(node())]"> > =A0 =A0 =A0<xsl:copy> > =A0 =A0 =A0 =A0<xsl:value-of select=3D"$response_file"/> > =A0 =A0 =A0</xsl:copy> > =A0 =A0</xsl:template> > > -- > > =A0 =A0 =A0 =A0 Martin Honnen > =A0 =A0 =A0 =A0http://JavaScript.FAQTs.com/ Thanks I appreciate your expertise and help | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
