473,513 Members | 2,537 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(xmlText)
Dim xslDoc As New XslTransform
xslDoc.Load(xslpath)
Dim sw As New StringWriter
xslDoc.Transform(doc, Nothing, sw, Nothing)
PageContent.Text = 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.ToString)
Nov 11 '05 #1
4 1916
I tried that it didnt work
"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:be***********@ID-152440.news.dfncis.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*******@grkjashdjkf.com> wrote in message
news:O7**************@TK2MSFTNGP12.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(xmlText)
Dim xslDoc As New XslTransform
xslDoc.Load(xslpath)
Dim sw As New StringWriter
xslDoc.Transform(doc, Nothing, sw, Nothing)
PageContent.Text = 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.ToString)


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*******@grkjashdjkf.com> wrote in message
news:us**************@TK2MSFTNGP10.phx.gbl...
I tried that it didnt work
"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:be***********@ID-152440.news.dfncis.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*******@grkjashdjkf.com> wrote in message
news:O7**************@TK2MSFTNGP12.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(xmlText)
Dim xslDoc As New XslTransform
xslDoc.Load(xslpath)
Dim sw As New StringWriter
xslDoc.Transform(doc, Nothing, sw, Nothing)
PageContent.Text = 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.ToString)



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(xmlText)
Dim xslDoc As New XslTransform
xslDoc.Load(xslpath)
Dim sw As New StringWriter
xslDoc.Transform(doc, Nothing, sw, Nothing)
PageContent.Text = sw.ToString
sw.Close()

How can i do a second transform?

"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:be************@ID-152440.news.dfncis.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*******@grkjashdjkf.com> wrote in message
news:us**************@TK2MSFTNGP10.phx.gbl...
I tried that it didnt work
"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:be***********@ID-152440.news.dfncis.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*******@grkjashdjkf.com> wrote in message
news:O7**************@TK2MSFTNGP12.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(xmlText)
> Dim xslDoc As New XslTransform
> xslDoc.Load(xslpath)
> Dim sw As New StringWriter
> xslDoc.Transform(doc, Nothing, sw, Nothing)
> PageContent.Text = 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.ToString)
>
>



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*******@grkjashdjkf.com> wrote in message
news:uj**************@tk2msftngp13.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(xmlText)
Dim xslDoc As New XslTransform
xslDoc.Load(xslpath)
Dim sw As New StringWriter
xslDoc.Transform(doc, Nothing, sw, Nothing)
PageContent.Text = sw.ToString
sw.Close()

How can i do a second transform?

"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:be************@ID-152440.news.dfncis.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*******@grkjashdjkf.com> wrote in message
news:us**************@TK2MSFTNGP10.phx.gbl...
I tried that it didnt work
"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:be***********@ID-152440.news.dfncis.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*******@grkjashdjkf.com> wrote in message
> news:O7**************@TK2MSFTNGP12.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(xmlText)
> > Dim xslDoc As New XslTransform
> > xslDoc.Load(xslpath)
> > Dim sw As New StringWriter
> > xslDoc.Transform(doc, Nothing, sw, Nothing)
> > PageContent.Text = 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.ToString)
> >
> >
>
>



Nov 11 '05 #5

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

Similar topics

1
4638
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...
1
8752
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...
3
1566
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...
4
2008
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
4427
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
1140
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
5003
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
1922
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,...
0
1170
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...
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7565
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...
0
7543
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...
0
5704
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5103
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...
0
4759
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...
0
3255
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...
0
1612
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

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.