Subject: Can I use Axes from Attribute Context Node? From: "S.Ramaswamy" <srswamy@xxxxxxxxxxxxxxxxxxxx> Date: Fri, 26 Nov 1999 05:04:26 +0530 |
I have the following XML fragment <browseList> <MxColumn>SUBCODE</MxCOlumn> <MxColumn>SUBDESC</MxColumn> </browseList> ............... ............... <bookhouse> <SUBJECT> <row SUBCODE="ANM" SUBDESC="Animal Science" CREATEDATE="1999-10-10" CREATEBY"BABY" /> <row SUBCODE="COM" SUBDESC="Computer Science" CREATEDATE="1998-12-10" CREATEBY"XYZ" /> <row SUBCODE="BIO" SUBDESC="Biology" CREATEDATE="1999-01-05" CREATEBY"ABC" /> <row SUBCODE="GEO" SUBDESC="Geography" CREATEDATE="1999-08-13" CREATEBY"BABY" /> </SUBJECT> </bookhouse> What I am trying to do ====================== I want to select bookhouse/SUBJECT/row/@SUBCODE and bookhouse/SUBJECT/row/@SUBDESC because these occur under /bookhouse/MxColumn Code I have tried ================= <xsl:for-each select="/bookhouse/SUBJECT/row"> <xsl:for-each select="@*"> <xsl:variable name="columnName" select="ancestor::browseList/MxColumn/." /> <!-- error on the above line ClassCast cannot cast to TXAttribute --> <xsl:if test='name()=$columnName'> <xsl:value-of select=current() /> </xsl:if> </xsl:for-each> </xsl:for-each> Am I not allowed to use ancestor from within Attribute Context Node? If not what will be the solution for the above? ==--==--==--==--==--==--==--==--==--==--==--==--==--== S.Ramaswamy Matrix Infotech Syndicate D-7, Poorti, Vikaspuri, New Delhi, 110018, India PHONE: +91-11-5610050, FAX: +91-11-5535103 WEB http://MatrixInfotech.HyperMart.Net ==--==--==--==--==--==--==--==--==--==--==--==--==--== XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: use TAG <br>, Ben Robb | Thread | RE: Can I use Axes from Attribute C, Kay Michael |
Re: Is there a public W3C Specifica, Stefano Mazzocchi | Date | Re: Extended file extentions (XfeX), James Tauber |
Month |