Re: [xsl] multi-document question

Subject: Re: [xsl] multi-document question
From: "Bruce D'Arcus" <bdarcus@xxxxxxxxxxx>
Date: Sun, 23 Nov 2003 11:10:52 -0500
On Nov 23, 2003, at 4:54 AM, Andreas L. Delmelle wrote:

Try replacing this:

         <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
         </xsl:copy>

with :


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

Thanks Andreas! This almost does this trick.


With this, then:

   <xsl:template match="mods">
        <exsl:document href="{@id}.mods" method="xml">
        <xsl:copy>
                <xsl:copy-of select="." />
        </xsl:copy>
        </exsl:document>
   </xsl:template>

I get this:

<mods>
   <mods id="one">
      <para>one</para>
   </mods>
</mods>

The problem is the repeating mods root elements, and I either need this...

<modsCollection>
   <mods id="one">
      <para>one</para>
   </mods>
</modsCollection>

...or just:

   <mods id="one">
      <para>one</para>
   </mods>

I assume I need to modify the <xsl:copy-of select="." />, but I'm unsure how.

Also, this schema requires a namespace declaration on the root. How do I get that in the xslt?

Finally, I should probably tackle is this:

I am using some identifier to name the individual files. In this case it is the id on the mods element. In other cases, it will be another element within mods called identifier with a type attribute value of citekey. In still other cases, this identifier may be missing altogether and I'd want to construct by perhaps selecting the first author family name and the year.

If I want to do this, what is the best strategy?

Thanks,
Bruce


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



Current Thread