Subject: Re: [xsl] document() loops From: "Laura Jenkins" <xsl_list@xxxxxxxxxxx> Date: Fri, 13 Sep 2002 08:50:26 +0000 |
<xsl:for-each select="document(/univ-xml-list/univ-xml[1])"> <xsl:variable name = "element-name" select="name(.)"/> <xsl:element name="$element-name">
</xsl:element> </xsl:for-each> this will create all the elements that are in the first elements..
But this does not work.. one of the univ xmls is as follows <?xml version="1.0"?> <university-records> <univ-ids> <univ id = "NSU"> <name> Newyork State University</name> <location> Newyork </location> </univ> <univ id = "BU"> <name> Belmont University</name> <location> Belmont </location> </univ> </univ-ids> <university-results> <university univ-id = "NSU">70%</university> <university univ-id = "BU">60%</university> </university-results> </university-records>
I do not know if there is any other way of doing this? Thanks
From: David Carlisle <davidc@xxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] document() loops Date: Thu, 12 Sep 2002 17:41:00 +0100
You say you want to merge the files but your two loops only have one node each (the root nodes of the first and second documents respectively). So as written you don't really need a for-each at all as there is only one node being used.
I posted some code before (I just noticed this is the same thread as the earlier question) does that not do what you expect?
David
_____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] document() loops, David Carlisle | Thread | Re: [xsl] document() loops, David Carlisle |
RE: [xsl] Matching on of many strin, TSchutzerWeissmann | Date | Re: [xsl] document() loops, David Carlisle |
Month |