Ma qualcuno di voi ha mai provato questo document()
VVoVe:
Vi posto del codice, se qualcuno mi fà un favore di provarlo.
Questo è il file1.xml
codice:
<?xml version="1.0" encoding="iso-8859-1"?>
<root>
<a>link-a1</a>
<a>link-a2</a>
<a>link-a3</a>
</root>
Questo è il file2.xml
codice:
<?xml version="1.0" encoding="iso-8859-1"?>
<root>
link-b1
link-b2
link-b3
</root>
Questo è il file.xsl che li trasforma entrambi.
codice:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="File_Xml_2" select="file2.xml" />
<xsl:template match="/">
<html>
<head>
</head>
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="a">
<xsl:value-of select="." />
</xsl:template>
<xsl:for-each selct="$File_Xml_2//root/b">
<xsl:value-of select="." />
</xsl:template>
</xsl:stylesheet>
Vi metto anche un file.aspx per provare
codice:
<%@ Page Language="vb" %>
<%@ import namespace="System.Xml" %>
<%@ import namespace="System.Xml.Xsl" %>
<script runat="server">
Sub Page_Load()
Dim Xml As New XmlDocument
Dim Xsl As New XslTrasform
Xml.Load("file1.xml")
Xsl.Load("file.xsl")
Xsl.Trasform(Xml, Nothing, Response.Output)
End Sub
</script>
Potete trasformarmarlo anche solo con IE per provare.
Le ho provate tutte ............ thank's