🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.xml
Article #9396

Modyfikowanie pobranego xml do transformacji

#9396
From: emoh
Date: Sun, 15 Jul 2007 15:01
35 lines
2041 bytes
Witam,
Mam dwa pliki xml i xsl Transformacja tych że plików daje zadawalajacy 
mi wynik jak i po stronie klijeta czy serwera wszystkie dane xml sa 
właściwie formatowane w xsl.

Po stronie serwera pobieram dwa pliki przekazuje do transformacji 
problem pojawia się taki że jak w gałązce pliku xml który jest ładowany 
do XmlDocument chciałbym dodać pewne atrybuty czy zmienić jej wartość.
<main>
  <top>
    <tytul tekst="(tu chcialbym cos zmienic)">(czy tutaj)

Transformacja na serwerze wyglada u mnie tak:
Kod C#
     private void tran(string Fxml, string Fxsl)
     {
         string xmlFileName = Server.MapPath(Fxml);
         string xslFileName = Server.MapPath(Fxsl);

         XslCompiledTransform xslt = new XslCompiledTransform();
         xslt.Load(xslFileName);
         XmlDocument xml = new XmlDocument();
         XmlTextReader xtr = new XmlTextReader(xmlFileName);
         xml.Load(xtr);

         StringBuilder sb = new StringBuilder();
         StringWriter sw = new StringWriter(sb);
         xslt.Transform(xml, null, sw);
         Response.Write(sb.ToString());
     }


Probowałem tworzyć dokument identyczny do tego co pobieram.
proszę wybacz wiem ze jest mnóstwo artykułów na temat zapisu lecz nie 
umie poskładać jednego konkretnego.
Technical Details
Message-ID: <f7dcsh$328$1@news.onet.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!not-for-mail
From: emoh <emoh@op.pl>
Newsgroups: pl.comp.xml
Subject: Modyfikowanie pobranego xml do transformacji
Date: Sun, 15 Jul 2007 17:01:41 +0200
Organization: Onet.pl
Lines: 35
Message-ID: <f7dcsh$328$1@news.onet.pl>
NNTP-Posting-Host: host-62-40-83-35.ustronet.net
Mime-Version: 1.0
X-Trace: news.onet.pl 1184511697 3144 62.40.83.35 (15 Jul 2007 15:01:37 GMT)
X-Complaints-To: usenet@news.onet.pl
NNTP-Posting-Date: Sun, 15 Jul 2007 15:01:37 +0000 (UTC)
X-Sender: 0AEG6BoJnQ+pIRjV2COFCg==
User-Agent: Thunderbird 2.0.0.4 (Windows/20070604)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit