Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
Iterating the attribute:: axis with Xalan
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Martin Hunter, post: 578819"] Hi All, I've written some XSLT and am using Apache Xalan 2.6 (Java version) to process it. I'm having trouble obtaining the name of nodes on the attribute axis of an element. Both the name() and local-name() xpath functions return a blank string. Here is my code. This function is designed to spit out an exact copy of the node parameter, and its children, bar text content of elements. It is part of a larger stylesheet. <xsl:template name="buildRecursive"> <xsl:param name="theNode" /> <xsl:for-each select="$theNode"> <xsl:element name="{name(self::node())}"> <xsl:for-each select="attribute::*"> <xsl:attribute name="{name()}"> <xsl:value-of select="." /> </xsl:attribute> </xsl:for-each> <xsl:for-each select="child::node()"> <xsl:call-template name="buildRecursive"> <xsl:with-param name="theNode" select="." /> </xsl:call-template> </xsl:for-each> </xsl:element> </xsl:for-each> </xsl:template> The XML content being processed is as follows: <?xml version="1.0" encoding="UTF-8"?> <document-resultset> <folder> <reference>dir</reference> <document> <reference>doc1.xml</reference> <version>0</version> <content> <some-rubbish><bloke nom="l'homme"/></some-rubbish> </content> </document> <document> <reference>doc2.xml</reference> <version>0</version> <content> <some-content hi="hi"/> </content> </document> </folder> </document-resultset> Any ideas why this doesn't work? Best regards, Martin Hunter. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
Iterating the attribute:: axis with Xalan
Top