[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
At 2010-12-11 17:51 -0500, Jimenez, Luis wrote:
I think your problem is above.
You don't say what is wrong, but when I ran your stylesheet I didn't get your desired results. It would help next time to bring focus to where you are having the problem.
In your stylesheet you are adding the remote document's information to the end of <pd>, yet in your desired result it seems you are adding the remote document's information to the end of <frmecc>. So I just changed the above to this which has the focus on the <frmecc> element:
... and I think it produces what you are asking for. Is that all that is wrong?
I hope this helps.
. . . . . . . . . . Ken
Re: [xsl] copy nodes() of other XML file
Subject: Re: [xsl] copy nodes() of other XML file From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Sat, 11 Dec 2010 18:06:31 -0500 |
At 2010-12-11 17:51 -0500, Jimenez, Luis wrote:
I'm trying to copy the contents of a node that is in one file to another, but must be copied into a document.
XSLT version 1.0
****** My main XML file: ... ****** My Second XML File - which should make the information: ... ****** My XSL File: ... <xsl:template match="pd"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> <xsl:variable name="id" select="frmecc/cab/ccon"/> <xsl:for-each select="$doc1"> <xsl:copy-of select="key('k1', $id)/detctacte"/> </xsl:for-each> </xsl:copy> </xsl:template>
I think your problem is above.
****** My Desired Output: ... Thanks to everyone for the help.
You don't say what is wrong, but when I ran your stylesheet I didn't get your desired results. It would help next time to bring focus to where you are having the problem.
In your stylesheet you are adding the remote document's information to the end of <pd>, yet in your desired result it seems you are adding the remote document's information to the end of <frmecc>. So I just changed the above to this which has the focus on the <frmecc> element:
<xsl:template match="frmecc"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> <xsl:variable name="id" select="cab/ccon"/> <xsl:for-each select="$doc1"> <xsl:copy-of select="key('k1', $id)/detctacte"/> </xsl:for-each> </xsl:copy> </xsl:template>
... and I think it produces what you are asking for. Is that all that is wrong?
I hope this helps.
. . . . . . . . . . Ken
-- Contact us for world-wide XML consulting & instructor-led training Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] copy nodes() of other XML fil, Jimenez, Luis | Thread | RE: [xsl] copy nodes() of other XML, Jimenez, Luis |
[xsl] copy nodes() of other XML fil, Jimenez, Luis | Date | RE: [xsl] copy nodes() of other XML, Jimenez, Luis |
Month |