[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSTL stylesheet workarounds for exceptions
Hi Michael,
Thanks for your suggestion which I have tried out without success still.
I can confirm that the namespace "ns" is correct and that the template I am applying to did pick up the correct <p>, where many other data including Hobbies (those with only a single child <a>) have been successfully extracted. However, there is only one Hobbies record with 2 child <a>s which may be the reason why XPath is not able to navigate pass both of them.
My next step would be to debug this stylesheet but any other suggestion would be more than welcome.
Thanks again,
Jack From: Michael Kay <mike@s...> To: Jack Bush <netbeansfan@y...>; xml-dev@l... Sent: Tuesday, 3 February, 2009 8:39:43 AM Subject: RE: XSTL stylesheet workarounds for exceptions You would really be much better off asking these questions on xsl-list at mulberrytech.com, especially at times when xml-dev is descending down philosophical rat-holes, which means the practical guys are hitting the delete button...
Most of your attempts look correct, assuming you have got the namespace right. They are all more complicated than they need to be; the following would do fine
<xsl:template match="ns:p[ns:strong='Hobbies:']">
<xsl:for-each select="ns:a"> <hobbies><xsl:value-of select="."/></hobbies> </xsl:for-each> </xsl:template> If that doesn't work, there are two explanations: either you've got the namespace declaration for "ns" wrong, or you aren't applying templates to the relevant <p> element. Either of those explanations would stop all the other attempts working as well. (It's a common story - people show us the code where they think the bug is, and all this reveals is that they are looking in the wrong place.) Michael Kay http://www.saxonica.com/
Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. http://au.rd.yahoo.com/homepage/mailtagline/*http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline.
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|