skrafner Posted January 25, 2011 Share Posted January 25, 2011 I'm very new to xml and xsl, so please excuse me if this is an easy one. I have a web db which is holding user entered information using html style text boxes. I've been exporting the db contents using xml and had created an xsl style sheet which displayed the data as I needed it in Word. My problem comes from an apparent upgrade in phpmyAdmin which changed the XML dump schema. Now I'm not sure how to reference the elements properly.My xml document did appear similar to what I have found on most websites where each field from the db table was a tag. for example, the field 'firstname' would appear as <firstname>John </firstname> and I could reference these using<xsl:value-of select="RecID"/>. The new download has the field in the format <column name ="firstname">John</column> and i'm not sure how to reference it the same way. I think it has to do with elements, but am quickly getting lost in the terminology.I would really, really appreciate any guidance or help on this.Thanks in advance,Skraf Link to comment Share on other sites More sharing options...
Martin Honnen Posted January 25, 2011 Share Posted January 25, 2011 I don't understand what <xsl:value-of select="RecID"/> is supposed to have to do with <firstname>John </firstname>.As for selecting <column name ="firstname">John</column> with XPath/XSLT, use <xsl:value-of select="column[@name = 'firstname']"/> Link to comment Share on other sites More sharing options...
skrafner Posted January 25, 2011 Author Share Posted January 25, 2011 Sorry, that was my typo mistake. RecID should have been 'firstname'Thanks very much for the reply and answer. You completely solved my problem!!Cheers, Skraf Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.