Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / July 2003

Tip: Looking for answers? Try searching our database.

How to transform an xml file with 2 xsl files?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Showjumper - 03 Jul 2003 20:55 GMT
I need to do a transform using 2 xsl files? How would i go about this? This
is what am doing now - just a single transform.
Dim XMLDoc As New XmlDocument
XMLDoc.Load(Server.MapPath("files/rdxmltemplate.xml"))
Dim XSLTrans As New Xsl.XslTransform
XSLTrans.Load(Server.MapPath("files/nitf-rd.xsl"))
Dim ms As New MemoryStream
XSLTrans.Transform(XMLDoc, Nothing, ms, Nothing)
ms.Seek(0, SeekOrigin.Begin)
Dim sr As New StreamReader(ms)
PageContent.Text = sr.ReadToEnd()
sr.Close()
Teemu Keiski - 03 Jul 2003 22:22 GMT
You mean you need to do it in two phases? In that case use the result of
first transformation as input for the second transformation. XmlDocument for
example can load the XML from Stream (say MemoryStream that was target
stream of the first transformation) abd you could use it again as input.

But if the need was to have to separate transformation, then use the same
XMLDocument as source for both and after doing the first transformation and
outputting results load the second XSLT stylesheet to the XslTransform and
redo the transformation.

If you need more specific information, plase tell bit more about your case.

Signature

Teemu Keiski
MCP, Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi

ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com

Email:
joteke@aspalliance.com

> I need to do a transform using 2 xsl files? How would i go about this? This
> is what am doing now - just a single transform.
[quoted text clipped - 8 lines]
> PageContent.Text = sr.ReadToEnd()
> sr.Close()
Showjumper - 04 Jul 2003 02:23 GMT
I am using the NITF DTD. One xsl is for the <body.head> and the other xsl is
for the <body.content>
> You mean you need to do it in two phases? In that case use the result of
> first transformation as input for the second transformation. XmlDocument for
[quoted text clipped - 21 lines]
> > PageContent.Text = sr.ReadToEnd()
> > sr.Close()
Teemu Keiski - 03 Jul 2003 22:25 GMT
And in addition see Oleg Tkachenko's message in thread:

"Do transformation output to string or xmlDoc and not a file or
xmltextwriter"

a couple of threads below this one

Signature

Teemu Keiski
MCP, Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi

ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com

Email:
joteke@aspalliance.com

> I need to do a transform using 2 xsl files? How would i go about this? This
> is what am doing now - just a single transform.
[quoted text clipped - 8 lines]
> PageContent.Text = sr.ReadToEnd()
> sr.Close()

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.