ramanaraokamma Posted October 7, 2013 Share Posted October 7, 2013 Hi, Thanks for looking at this. I am new to XSLT, browsed in google, nothing is appropriate to my requirement. I have 2 xml files like below Example. 1.xml <parameters> <param> <Name>Ramana</Name> <Number>1234</Number> </param> </parameters> -------------------- 2.xml <parameters> <param> <Name>Rao</Name> <Number>4321</Number> </param> </parameters> ---------------------------- My xsl file looks like below <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.bluwo.com/xml/Interface" xmlns:tns="http://www.bluwo.com/xml/Interface"> <xsl:output method="xml" indent="yes" /> <xsl:template match="/"> <<xsl:for-each select="parameters/param"> <Name> <xsl:value-of select="Name"/> </Name> <Name> <xsl:value-of select="Number"/> </Name> </xsl:for-each> </xsl:template> </xsl:stylesheet> --------------------- my xls file is working fine for any of the files, but I wanted to read from both of my xml files. I heard about document(), but not clear how to modify my present xls file for this. I don't have any problem to read from a combined file "both my 1.xml 2.xml in separatefile like both.xml" <files> <file filename="~/1.xml"/> <file filename="~/2.xml"/> </files> Appreciate the help here. Thanks, Ramana Link to comment Share on other sites More sharing options...
Martin Honnen Posted October 7, 2013 Share Posted October 7, 2013 Change <xsl:for-each select="parameters/param"> to <xsl:for-each select="parameters/param |document('file2.xml')/parameters/param"> Link to comment Share on other sites More sharing options...
ramanaraokamma Posted October 8, 2013 Author Share Posted October 8, 2013 Hi Martin, This worked, thanks a lot for your help. thanks, Ramana Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now