No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
10 Posted Topics
name's element and name's type are completely different thing. If you have a problem, it's not in this piece of code Could you give your complete xml schema ?
I try to make a generic code, i expect it's not too difficult to endurstand [CODE]<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:key name="copy" match="c/d1|c/d2" use="generate-id(..)"/> <xsl:key name="up" match="c/d2" use="generate-id(..)"/> <xsl:template match="node()"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template> <xsl:template match="text()"> <xsl:value-of select="."/> </xsl:template> <xsl:template match="@*"> <xsl:attribute name="{name()}"><xsl:value-of …
It's the first text() node so : [CODE]<xsl:value-of select="text()[1]">[/CODE]
Something like that ? [CODE]<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:apply-templates mode="copy"/> </xsl:template> <xsl:template match="@*|node()" mode="copy"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="copy"/> </xsl:copy> </xsl:template> <xsl:template match="*[not(descendant-or-self::*[text() | @*])]" mode="copy"> <xsl:variable name="names"> <xsl:apply-templates select="self::node()" mode="delete"/> </xsl:variable> <xsl:message> <xsl:value-of select="$names"/> </xsl:message> </xsl:template> <xsl:template match="*" mode="delete"> Node <xsl:value-of select="local-name()"/> removed;<xsl:apply-templates select="*" mode="delete"/> </xsl:template> …
I'm sorry but i don't understand what you try to do... Your XSLT is very odd, seems false to me. Could you explain what you try to do with a more simple xml and xslt, please ?
eliminating double in XPat 1.0 use this syntax [CODE]<xsl:for-each select="/*/Rows[not(@alphakey=preceding-sibling::*/@alphakey)]"> ... [/CODE] but it's not a good choice with XSLT (very hard cost). You must use muench method as i say here : [url]http://www.daniweb.com/forums/thread342766.html[/url]
It's a gouping problem. In XSLT 1.0 we have to use muench method First step : eliminate double second step : call all element with same "key" value [CODE]<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:key match="Row" use="@alphakey" name="row"></xsl:key> <xsl:template match="/"> <table> <tbody> <xsl:for-each select="/*/Row[generate-id(.)=generate-id(key('row',@alphakey)[1])]"><tr> <td><xsl:value-of …
when there are some namespace used in a xml you MUST rewrite them with prefixe in your XSLT,without adding the namespaces, all your xpath and match attribute which use a name are false Try that [CODE]<?xml version="1.0" ?><xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://foo.bar.com/something"> <xsl:output method="xml" indent="yes" encoding="windows-1252" /> <xsl:template match="@*|*"> <xsl:copy> <xsl:apply-templates …
Hi, First sorry for my poor english. Your XSLT is good. I only have one problem when I make test with [CODE] exclude-result-prefixes="java wcm"[/CODE] Xmlspy don't like but i don't think it's the error. I must make one change for testing [CODE]<xsl:param name="relatedDocumentsXML" />[/CODE] by [CODE]<xsl:param name="relatedDocumentsXML" select="/*" />[/CODE] May …
First excuse me for my pour english. You can't add an picture(jpeg,gif,png...) in your XML but you have two ohter choice. 1) add the adress of your company logo 2) code the picture in SVG , an XML format for graphics
The End.
Erwan Amoureux