473,767 Members | 2,224 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Transforming an xml file w/ 2 xsl files - still havent figured it out

I am using the NITF DTD for my xml files and i need to use 2 xsl files to do
the transform: one for the <body.head> and the second for the
<body.content >. I've got this so far for transforming using 1 xsl file:

Dim doc As New XmlDocument
doc.LoadXml(xml Text)
Dim xslDoc As New XslTransform
xslDoc.Load(xsl path)
Dim sw As New StringWriter
xslDoc.Transfor m(doc, Nothing, sw, Nothing)
PageContent.Tex t = sw.ToString
sw.Close()

Can i just pass the stringwriter to a new xml document and then do a
transform like i did previously but using the second xsl file?

Dim x2 As New XmlDocument
x2.LoadXml(sw.T oString)
Nov 11 '05 #1
4 1933
I tried that it didnt work
"Dimitre Novatchev" <dn********@yah oo.com> wrote in message
news:be******** ***@ID-152440.news.dfn cis.de...
A pure XSLT solution is to use xsl:import for the second xsl file.
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
"Showjumper " <sh*******@grkj ashdjkf.com> wrote in message
news:O7******** ******@TK2MSFTN GP12.phx.gbl...
I am using the NITF DTD for my xml files and i need to use 2 xsl files
to do
the transform: one for the <body.head> and the second for the
<body.content >. I've got this so far for transforming using 1 xsl file:

Dim doc As New XmlDocument
doc.LoadXml(xml Text)
Dim xslDoc As New XslTransform
xslDoc.Load(xsl path)
Dim sw As New StringWriter
xslDoc.Transfor m(doc, Nothing, sw, Nothing)
PageContent.Tex t = sw.ToString
sw.Close()

Can i just pass the stringwriter to a new xml document and then do a
transform like i did previously but using the second xsl file?

Dim x2 As New XmlDocument
x2.LoadXml(sw.T oString)


Nov 11 '05 #2
As you're not providing a source xml document, nor you're explaining what
you wish to achieve, the probability that someone can help you is quite low.
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
"Showjumper " <sh*******@grkj ashdjkf.com> wrote in message
news:us******** ******@TK2MSFTN GP10.phx.gbl...
I tried that it didnt work
"Dimitre Novatchev" <dn********@yah oo.com> wrote in message
news:be******** ***@ID-152440.news.dfn cis.de...
A pure XSLT solution is to use xsl:import for the second xsl file.
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
"Showjumper " <sh*******@grkj ashdjkf.com> wrote in message
news:O7******** ******@TK2MSFTN GP12.phx.gbl...
I am using the NITF DTD for my xml files and i need to use 2 xsl files

to
do
the transform: one for the <body.head> and the second for the
<body.content >. I've got this so far for transforming using 1 xsl file:
Dim doc As New XmlDocument
doc.LoadXml(xml Text)
Dim xslDoc As New XslTransform
xslDoc.Load(xsl path)
Dim sw As New StringWriter
xslDoc.Transfor m(doc, Nothing, sw, Nothing)
PageContent.Tex t = sw.ToString
sw.Close()

Can i just pass the stringwriter to a new xml document and then do a
transform like i did previously but using the second xsl file?

Dim x2 As New XmlDocument
x2.LoadXml(sw.T oString)



Nov 11 '05 #3
As i as said in the intial post: the first xsl transforms the <body.head>
and the second xsl is for transforming the <body.content >. A xml doc using
the NITF DTD has a structure like:

<nitf>
<head>
<!--
Metadata about the document as a whole
goes here.
-->
</head>

<body>
<body.head>
<!--
This section holds core news components,
such as headline and byline, that are commonly
displayed before the text of an article.
-->
</body.head>

<body.content >
<!--
This section holds the article,
generally consisting of paragraphs of text,
but perhaps with embedded tables, lists,
photos, and other items. These can also be
referenced by specifying a location on the
Internet or another computer.
-->
</body.content>

<body.end>
<!--
This section holds core news components
that are commonly displayed at the end of
an article.
-->
</body.end>
</body>
</nitf>

I am using the following to acheive the single transform:
Dim doc As New XmlDocument
doc.LoadXml(xml Text)
Dim xslDoc As New XslTransform
xslDoc.Load(xsl path)
Dim sw As New StringWriter
xslDoc.Transfor m(doc, Nothing, sw, Nothing)
PageContent.Tex t = sw.ToString
sw.Close()

How can i do a second transform?

"Dimitre Novatchev" <dn********@yah oo.com> wrote in message
news:be******** ****@ID-152440.news.dfn cis.de...
As you're not providing a source xml document, nor you're explaining what
you wish to achieve, the probability that someone can help you is quite low.

=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
"Showjumper " <sh*******@grkj ashdjkf.com> wrote in message
news:us******** ******@TK2MSFTN GP10.phx.gbl...
I tried that it didnt work
"Dimitre Novatchev" <dn********@yah oo.com> wrote in message
news:be******** ***@ID-152440.news.dfn cis.de...
A pure XSLT solution is to use xsl:import for the second xsl file.
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
"Showjumper " <sh*******@grkj ashdjkf.com> wrote in message
news:O7******** ******@TK2MSFTN GP12.phx.gbl...
> I am using the NITF DTD for my xml files and i need to use 2 xsl
files
to
do
> the transform: one for the <body.head> and the second for the
> <body.content >. I've got this so far for transforming using 1 xsl

file: >
> Dim doc As New XmlDocument
> doc.LoadXml(xml Text)
> Dim xslDoc As New XslTransform
> xslDoc.Load(xsl path)
> Dim sw As New StringWriter
> xslDoc.Transfor m(doc, Nothing, sw, Nothing)
> PageContent.Tex t = sw.ToString
> sw.Close()
>
> Can i just pass the stringwriter to a new xml document and then do a
> transform like i did previously but using the second xsl file?
>
> Dim x2 As New XmlDocument
> x2.LoadXml(sw.T oString)
>
>



Nov 11 '05 #4
> How can i do a second transform?

Why should you do a second transform?

Just xsl:import the second xsl stylesheet file. It will contain a template
matching "body.head" .
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL


"Showjumper " <sh*******@grkj ashdjkf.com> wrote in message
news:uj******** ******@tk2msftn gp13.phx.gbl...
As i as said in the intial post: the first xsl transforms the <body.head>
and the second xsl is for transforming the <body.content >. A xml doc using
the NITF DTD has a structure like:

<nitf>
<head>
<!--
Metadata about the document as a whole
goes here.
-->
</head>

<body>
<body.head>
<!--
This section holds core news components,
such as headline and byline, that are commonly
displayed before the text of an article.
-->
</body.head>

<body.content >
<!--
This section holds the article,
generally consisting of paragraphs of text,
but perhaps with embedded tables, lists,
photos, and other items. These can also be
referenced by specifying a location on the
Internet or another computer.
-->
</body.content>

<body.end>
<!--
This section holds core news components
that are commonly displayed at the end of
an article.
-->
</body.end>
</body>
</nitf>

I am using the following to acheive the single transform:
Dim doc As New XmlDocument
doc.LoadXml(xml Text)
Dim xslDoc As New XslTransform
xslDoc.Load(xsl path)
Dim sw As New StringWriter
xslDoc.Transfor m(doc, Nothing, sw, Nothing)
PageContent.Tex t = sw.ToString
sw.Close()

How can i do a second transform?

"Dimitre Novatchev" <dn********@yah oo.com> wrote in message
news:be******** ****@ID-152440.news.dfn cis.de...
As you're not providing a source xml document, nor you're explaining what
you wish to achieve, the probability that someone can help you is quite

low.


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
"Showjumper " <sh*******@grkj ashdjkf.com> wrote in message
news:us******** ******@TK2MSFTN GP10.phx.gbl...
I tried that it didnt work
"Dimitre Novatchev" <dn********@yah oo.com> wrote in message
news:be******** ***@ID-152440.news.dfn cis.de...
> A pure XSLT solution is to use xsl:import for the second xsl file.
>
>
> =====
> Cheers,
>
> Dimitre Novatchev.
> http://fxsl.sourceforge.net/ -- the home of FXSL
>
>
> "Showjumper " <sh*******@grkj ashdjkf.com> wrote in message
> news:O7******** ******@TK2MSFTN GP12.phx.gbl...
> > I am using the NITF DTD for my xml files and i need to use 2 xsl

files to
> do
> > the transform: one for the <body.head> and the second for the
> > <body.content >. I've got this so far for transforming using 1 xsl

file:
> >
> > Dim doc As New XmlDocument
> > doc.LoadXml(xml Text)
> > Dim xslDoc As New XslTransform
> > xslDoc.Load(xsl path)
> > Dim sw As New StringWriter
> > xslDoc.Transfor m(doc, Nothing, sw, Nothing)
> > PageContent.Tex t = sw.ToString
> > sw.Close()
> >
> > Can i just pass the stringwriter to a new xml document and then do a > > transform like i did previously but using the second xsl file?
> >
> > Dim x2 As New XmlDocument
> > x2.LoadXml(sw.T oString)
> >
> >
>
>



Nov 11 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4673
by: balzano_1 | last post by:
Hi, im trying to upload a file from a client (windows) to an ftp server (linux), i deciede to use some of php`s functions to connect and authenticate etc.. i only wish to put a file on the server, so i used ftp_put() function, when i send the file via http, the file is created on the server, but it is empty, i checked the permissions and all are set correctly, i figured if it is empty it means it cant find the file im trying to upload, i...
1
8761
by: H | last post by:
Hi, I have written a small game with a aroud 20 sounds. At the moment these wave files are just put into a folder and called using the playsound function. Is there a way to embed these files into the vb app? Ive read about resource files but havent found any useful info on how to use them. is there another way to do this or even a website explaining how to do this?
3
1578
by: Cat | last post by:
Hey all, I am getting the following error when running a transformation on an xml document: Public member 'Current' on type 'XPathQueryIterator' not found. Has anyone seen this before? I have looked through the code and havent seen anythig at least in VB.NET that refs the 'XPathQueryIterator' . Also the web has virtually nothing on this error at all. Any and all help would be greatly appreciated.
4
2028
by: Cathie | last post by:
Hi All, I am trying to get my style sheet to work. It works fine in IE but I can't get it to work in .net. Below is the function I use for transforming, where advancedOptionsFile is the path to the file containing an XML document required by the transformation, and xmlSimplified is the XML document to trasform. ---------------------------------------------------------------------------- -------------------------------
3
4454
by: Bobby | last post by:
I have a schema and have used XSDObjectGen.exe to create a set of classes that represent the schema. What is the best way to fill xsdobjectgen.exe generated classes with data? I want to create and serialize an instance of one of the classes in this schema. the class is declared publicly, but isn't accessible outside the namespace: ...
1
1151
by: me | last post by:
Hello, I have serveral xml files that will have the same formatting, like this: <bio> <title>xxxxx</title> <info>yadayadayada</info> <source>Bill Gates</source>
2
5013
by: Ven | last post by:
does anyone know where the docs are (or sample code) to register an extension so that FileExplorer launches your application when the user double clicks your file? i havent seen this in the dotnetframework itself.. thanks in advance!
24
1955
by: Kelly | last post by:
Hey all - I need a little more help. I don't quite know why my text file or form isn't closing. Short version - this program takes data entered into a textbox, user clicks Save button, Save As dialog box pops open, user selects file to save to, data *should* save to the file, file close, form close. The way I have it written so far, the data *does* save to the file, however,
0
1179
by: wwwmike | last post by:
Hi there, I am using the standard fileupload server tool in asp.net 2.0 to upload files to my server. Everything works perfectly until I figured out that certain files (under 4MB) gave me an error like it happens when you upload files greater then 4MB. This happend to files with a size of 200kb. After 10 hours of intense brainwork, I figured out that when a file is locked by windows xp, any attempt to upload this file, which size ever,
0
10009
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9838
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.