Hi Luca. Thank you for answering. Yes, probably that's something with my configuration. I am using Win98, Tomcat 4.1.12, Cocoon 2.0.4, Xalan 2.4.1. I'll try to change the Xalan version. Anyway, this thing is very weird.
Thank you. Anna ----- Original Message ----- From: "Luca Morandini" <[EMAIL PROTECTED]> To: "Cocoon-users" <[EMAIL PROTECTED]> Sent: Thursday, December 19, 2002 10:43 AM Subject: RE: XPath problem in Cocoon? Anna, this is the output I got from your code: <?xml version="1.0" encoding="iso-8859-1" ?> <root xmlns:fo="http://www.w3.org/1999/XSL/Format">HELLO P content = some text</root> ...which I suppose to be the right one. Therefore, could it be a problem related to the configuration you're using ? My configuration is: - Windows 2000 Prof SP3 - Tomcat 4.0.1 - Cocoon 2.0.3 with Xalan 2.2.0.D13 (yes, Xalan 2.3.1 has some bugs, and I decided to step down a little). If I were you, I would; - Change the Xalan version and, provided that doesn't work: - Change the Cocoon version (provided you're not using 2.0.3, of course) Best regards, --------------------------------------------- Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html --------------------------------------------- > -----Original Message----- > From: Anna Afonchenko [mailto:[EMAIL PROTECTED]] > Sent: Thursday, December 19, 2002 8:35 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: XPath problem in Cocoon? > > > Hi Luca. > Thank you so much for help. > Here are all my components: > > 1. the pipeline: > > <map:match pattern="*.html"> > <map:generate src="{1}.html" type="html"/> > <map:transform src="test.xsl"/> > <map:serialize type="xml"/> > </map:match> > > 2. the imput file (test.html): > > <html> > <head> > <title>Untitled</title> > </head> > <body> > <p>some text</p> > </body> > </html> > > 3. the xsl (test.xsl): > > <?xml version="1.0" encoding="UTF-8"?> > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:fo="http://www.w3.org/1999/XSL/Format" > xmlns:saxon="http://icl.com/saxon" > extension-element-prefixes="saxon"> > > <xsl:template match="/"> > <xsl:element name="root"> > <xsl:text>HELLO </xsl:text> > <xsl:for-each select="//p"> > <xsl:text>P content = </xsl:text> > <xsl:value-of select="."/> > </xsl:for-each> > </xsl:element> > </xsl:template> > </xsl:stylesheet> > > As you can see, with such xml and xsl I should have one match for p element > and it's content should be output inside the root element. But it just > doesn't happen, it doesn't match the node. And now the interesting part > strats: > If I replace the select attribute of xsl:for-each to be > "descendant::node()[name()='p']" > instead of just "//p" (those two expressions mean exactly the same in the > XPath), > I suddenly get the match and the right answer from Cocoon. > Also, if I run this stylesheet externally of Cocoon (for example, using > XMLSpy XSLTransformation tool) I get the right answer for match "//p". > > So I know that my stylesheet is OK, but I can't understand why it doesn't > work from Cocoon. > If somebody can explain this thing for me, I would be more than happy, > because I can't use the descendant::... style instead the // style in my > real (big) stylesheet. > > Thank you all very much. > Hope somebody can help me with this. > > Regards, > Anna > > --------------------------------------------- Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html --------------------------------------------- --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]> --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>