[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Combining xml file manipulation into one xsl


Subject: Re: [xsl] Combining xml file manipulation into one xsl
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 2 Oct 2003 10:55:22 +0100

> but I don't know enough keys to really know what I'm doing.  Any suggestions.
It appears I didn't either last night:-)
My key was for your "other" file pulled in by document() but the way I had
it it was being looked up in the main input file, so didn't work.
That was probably fixable but as I tell other people: get it working
before getting it optimised, so here's a version without keys.

Also it removes all the indentation in the input with <xsl:strip-space 
and puts it all back with  indent="yes" so the bits coming from the two
different files are indented in teh same way, as it looked untidy when I
tested it. (I did test it this time:-)

David


<?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" indent="yes" omit-xml-declaration="yes"/>
<xsl:strip-space elements="*"/>

<xsl:variable name="master" select="document('tblMasterFile.xml')"/>
  <xsl:template match="/">
     <CodeLibrary>

    <xsl:apply-templates
select="doxygenindex/compound[not(name=$master/CodeLibrary/File/Name)]|$master/CodeLibrary/File">
       <xsl:sort select="name|Name"/>
    </xsl:apply-templates>
    </CodeLibrary>
  </xsl:template>

  <xsl:template match="doxygenindex/compound">
    <File>
    <Name><xsl:value-of select="name"/></Name>
    <Type><xsl:value-of select="@kind"/></Type>
    <BriefDescription/>
    <SourceFileName><xsl:value-of select="@refid"/></SourceFileName>
    <IgnoreFlag>77</IgnoreFlag>  
    </File>
  </xsl:template>

<xsl:template match="File">
  <xsl:copy-of select="."/>
</xsl:template>


</xsl:stylesheet>

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread