xsl-list
[Top] [All Lists]

Re: [xsl] 2 XML Files, 1 XSLt Output to HTML

2006-10-18 10:21:53
McDonald, Shaun wrote:
XSLT Version 1.0:
<xsl:template match="n1:share">
    <xsl:variable name="x" select="@item" />
    <xsl:variable name="xx" select="@loc" />
    <xsl:for-each select="document(@loc)">
      <xsl:value-of select="current()"/>
    </xsl:for-each>
 </xsl:template>

I want,
TARGET: doc2.xml:
<Oproc>
        <Para>
                <bold id="ao1">text1</bold>
                <extRef id="getmaster" href="somedoc.html#idTitle1234"
reflocation="*" refmanual=""/>
        </Para>


You are using <xsl:value-of> here. Surely that's not what you want. You don't want the *value* (which returns a string representation of the nodes in the select expression) but a *copy* of all the nodes. Change "value-of" to "copy-of" and you are done (it will copy comment nodes and processing instructions as well but not the opening xml declaration).

Another little thing, why the for-each? You can remove it and just use:
<xsl:copy-of select="document(@loc)" />

(it is only from xslt 2.0 that document(xx) function can be used on a sequence and will return multiple documents, in which case the for-each could make sense)

Cheers,

-- Abel Braaksma
  http://www.nuntia.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>