Re: Simple XSL problem, but NEED HELP!
On Thursday 28 March 2002 09:50 am, Hahn Kurt (CHA) wrote: . . . xsl:value-of select=//content/ . . . gives me everything in the original document, and that's OK. However, I replace content with some other element, like xsl:value-of select=//row/ it gives me just an empty tag Most probably row is in a different namespace, in which case you have to indicate the namespace in the match pattern, something like xsl:value-of select=//sql:row/ assuming the sql namespace (or whatever prefix you want to use) is declared properly. -- Bertrand Delacrétaz (codeconsult.ch, jfor.org) buzzwords: XML, java, XSLT, cocoon, mentoring/teaching/coding. disclaimer: eternity is very long. mostly towards the end. get ready. - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Simple XSL problem, but NEED HELP!
Hi, *** REPLY SEPARATOR *** On 28.03.2002 at 09:50 Hahn Kurt (CHA) wrote: I really start losing it, I'm trying to do something very simple for hours, and it just wouldn't work. With an XML document like this: page (root element) content rowset row loj_pt_odj / obj_numero_gctext/obj_numero_gc obj_soustypetext/obj_soustype obj_concattitregc1text /obj_concattitregc1 obj_concattitregc2 / /row .../rowset . /content I'm trying to do some simple transformations. This: xsl:template match=/ listeAffaires xsl:value-of select=//content/ /listeAffaires /xsl:template gives me everything in the original document, and that's OK. This is strange, it shouldn't return anything but the value of the content tag. However, I replace content with some other element, like xsl:value-of select=//row/ it gives me just an empty tag, although, according to my XSL sources, the operator // can be used to reference as many levels down in the hierarchy as necessary. Can anybody help me out here? At least in your example the row tag has no value, so it is absolutely correct that nothing is returned. If you use xsl:value-of, you will only get the value of the matched tag. Greetings, Andreas - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.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/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Simple XSL problem, but NEED HELP!
-Message d'origine- De: Andreas Hartmann [mailto:[EMAIL PROTECTED]] Hi, / At least in your example the row tag has no value, so it is absolutely correct that nothing is returned. If you use xsl:value-of, you will only get the value of the matched tag. If you want a copy of all the tag, us xsl:copy. If you need to copy all the tag, attributs, and inner tag, you can use recursive-copy by using a named template and applying your template to the node to be copyed. I think that the template should look like : xsl:template name=copyall xsl:copy xsl:for-each select=@*|node() xsl:call-templates name=copyall/ /xsl:copy /xsl:template hope this works, i've not practiced for a long time :) Greetings, Andreas - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Simple XSL problem, but NEED HELP!
Actually, the problem was something else, somebody else just pointed me to check for different namespaces, and that solved the problem, I needed to reference the elements with their corresponding NS. Thanks -Message d'origine- De: TREGAN Fabien [mailto:[EMAIL PROTECTED]] Date: jeudi, 28. mars 2002 10:45 À: '[EMAIL PROTECTED]' Objet: RE: Simple XSL problem, but NEED HELP! -Message d'origine- De: Andreas Hartmann [mailto:[EMAIL PROTECTED]] Hi, / At least in your example the row tag has no value, so it is absolutely correct that nothing is returned. If you use xsl:value-of, you will only get the value of the matched tag. If you want a copy of all the tag, us xsl:copy. If you need to copy all the tag, attributs, and inner tag, you can use recursive-copy by using a named template and applying your template to the node to be copyed. I think that the template should look like : xsl:template name=copyall xsl:copy xsl:for-each select=@*|node() xsl:call-templates name=copyall/ /xsl:copy /xsl:template hope this works, i've not practiced for a long time :) Greetings, Andreas - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.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/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Simple XSL problem, but NEED HELP!
Hi, To copy all types of all level sub-nodes you can use copy-of tag: xsl:copy-of select=some_element/ In this case you need not special template with for-each processing. Best regards. Roman Hahn Kurt (CHA) wrote: Actually, the problem was something else, somebody else just pointed me to check for different namespaces, and that solved the problem, I needed to reference the elements with their corresponding NS. Thanks -Message d'origine- De: TREGAN Fabien [mailto:[EMAIL PROTECTED]] Date: jeudi, 28. mars 2002 10:45 À: '[EMAIL PROTECTED]' Objet: RE: Simple XSL problem, but NEED HELP! -Message d'origine- De: Andreas Hartmann [mailto:[EMAIL PROTECTED]] Hi, / At least in your example the row tag has no value, so it is absolutely correct that nothing is returned. If you use xsl:value-of, you will only get the value of the matched tag. If you want a copy of all the tag, us xsl:copy. If you need to copy all the tag, attributs, and inner tag, you can use recursive-copy by using a named template and applying your template to the node to be copyed. I think that the template should look like : xsl:template name=copyall xsl:copy xsl:for-each select=@*|node() xsl:call-templates name=copyall/ /xsl:copy /xsl:template hope this works, i've not practiced for a long time :) Greetings, Andreas - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.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/faqs.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/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]