Article View: pl.comp.xml
Article #10282xslt - prosba o pomoc
From: rleg2000
Date: Tue, 18 Jun 2013 21:00
Date: Tue, 18 Jun 2013 21:00
50 lines
2474 bytes
2474 bytes
Witam, mam nastepujacy dokument XML (ksiazka) <book> <t p="1">Tytul <i>rozdzialu</i></t> <t p="2">Podtytul rodzialu</t> <item nr="1"> Paragraf 1 </item> <item nr="2"> Paragraf 2 </item> itd </book> Chcialbymzmodyfikowac plik XML tak, aby dodac do tytulow najblizszy "nr" z "item" napisalem plik XSLT: <?xml version='1.0'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:import href="copy.xslt"/> <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="no" indent="yes" media-type="text/xml"/> <xsl:template match="t"> <xsl:copy><xsl:copy-of select="@*"/>[<xsl:value-of select="following-sibling::item/@nr"/>] <xsl:value-of select="."/></xsl:copy> </xsl:template> </xsl:stylesheet> Otrzymuje: <t p="1">[1] Tytul rozdzialu</t> a chcialbym uzyskac: <t p="1">[1] Tytul <i>rozdzialu</i></t> czyli gubie znaczniki kusywy. Jak poprawic moj plik XSLT, ewentualnie moze trzeba wszystko zmienic? Jesli mozna, to prosze o cos dokladnego, bo nie jestem zadnym specjalista. Pozdrawiam Robert PS uzywam msxml, a plik "copy.xslt" jest nastepujacy: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="node( ) | @*"> <xsl:copy> <xsl:apply-templates select="@* | node( )"/> </xsl:copy> </xsl:template> </xsl:stylesheet>
Technical Details
Message-ID:
<a40f5135-226a-49b0-9293-7387ccc0fe0c@googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.cyf-kr.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!news.glorb.com!j2no678609qak.0!news-out.google.com!y6ni3510qax.0!nntp.google.com!j2no678607qak.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mailShow Full Headers
Complete Article Headers
X-Received: by 10.224.57.65 with SMTP id b1mr407982qah.2.1371589206241; Tue, 18 Jun 2013 14:00:06 -0700 (PDT) X-Received: by 10.49.116.132 with SMTP id jw4mr532010qeb.33.1371589206216; Tue, 18 Jun 2013 14:00:06 -0700 (PDT) Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.cyf-kr.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!news.glorb.com!j2no678609qak.0!news-out.google.com!y6ni3510qax.0!nntp.google.com!j2no678607qak.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: pl.comp.xml Date: Tue, 18 Jun 2013 14:00:06 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=83.17.169.154; posting-account=-0d7QAoAAACcoB5MUZQMIF_EGj4vE6di NNTP-Posting-Host: 83.17.169.154 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <a40f5135-226a-49b0-9293-7387ccc0fe0c@googlegroups.com> Subject: xslt - prosba o pomoc From: rleg2000@gmail.com Injection-Date: Tue, 18 Jun 2013 21:00:06 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit