Skip to content

Instantly share code, notes, and snippets.

@mwfrost
Created February 9, 2011 22:02
Show Gist options
  • Select an option

  • Save mwfrost/819403 to your computer and use it in GitHub Desktop.

Select an option

Save mwfrost/819403 to your computer and use it in GitHub Desktop.
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsd="http://www.exchangenetwork.net/schema/ghg/1" >
<xsl:template match="*|@*">
<xsl:value-of select="
string-join(
(//*|//@*)
/string-join(
(ancestor::node()/
(
if (exists(@name))
then @name
else
if (exists(@ref))
then @ref
else
if (exists(@base))
then @base
else
local-name()
)
,
concat(
if( self::attribute() )
then
if (local-name() = 'name')
then ''
else
concat('@', local-name() , ' = ' , string())
else
concat(
if ( exists( @name | @ref | @base ) )
then concat( @name, @ref, @base )
else
local-name() ,
''
)
, ''
)
),
'/'),
'&#xA;')"/>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment