Jump to content

Kevin Goodman

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Kevin Goodman

  1. Actually, this is from an example of how to copy elements and data where the element is a node or an attribute.
  2. I'm trying to perform a xsl:copy of a xml file and re-format a couple of attribute contents. From what I've read and the examples I've seen I've been able to make the copy but its not applying or matching my templates. I'm running from a Java app and I get a xml output file and I get no errors. But the contents is the same as the original. Any pointers are appreciated. Here is the xsl file. <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:AG="http://support.agile.com/misc/axml/2005/11/"xmlns="http://www.w3.org/TR/html4"xsi:schemaLocation="http://support.agile.com/misc/axml/2004/12/ http://support.agile.com/misc/axml/2004/12/"><xsl:output method="html"/> <!-- Whenever you match any node or any attribute --> <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates/> <!-- select="@*|node()" --> </xsl:copy> </xsl:template> <xsl:template match="Description"> <xsl:element name="Description"> <xsl:variable name="Desc" select="substring(AG:TitleBlock/AG:Description, 1, 36)"/> <xsl:variable name="DescUpper" select="xsl:upper-case($Desc)"/> <xsl:value-of select="$DescUpper"/> </xsl:element> </xsl:template> <xsl:template match="Rev"> <xsl:element name="Rev"> <xsl:variable name="revision" select="AG:TitleBlock/AG:Rev" /> <xsl:value-of select="substring-before($revision, ' ')"/> </xsl:element> </xsl:template></xsl:stylesheet>
×
×
  • Create New...