Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

XML Transform to XML with XSL

[es] :: XML :: XML Transform to XML with XSL

[ Pregleda: 1972 | Odgovora: 6 ]

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

dejanos
Dejan Ostojic
Novi Sad

Član broj: 44613
Poruke: 3
..mtsns-ns.customer.sbb.co.yu.



Profil

icon XML Transform to XML with XSL19.04.2006. u 14:01

Pozdrav svima!

Imam xml file:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="contacts.xsl"?>

<contacts>
<contact id="1">
<ime>Ime 1</ime>
<prezime>Prezime 1</prezime>
</contact>
<contact id="2">
<ime>Ime 2</ime>
<prezime>Prezime 2</prezime>
</contact>
</contacts>

I preko xsl-a teba da ga transformisem u slican xml file:
<contacts>
<contact>
<userID>1</userID>
<firstName>Ime 1</firstName>
<lastName>Prezime 1</lastName>
</contact>
<contact>
<userID>2</userID>
<firstName>Ime 2</firstName>
<lastName>Prezime 2</lastName>
</contact>
</contacts>

I napravio sam xsl file:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<contacts>
<xsl:apply-templates/>
</contacts>
</xsl:template>

<xsl:template match="contacts">
<xsl:for-each select="contact">
<contact>
<userID><xsl:value-of select="@id"/></userID>
<firstName><xsl:value-of select="ime"/></firstName>
<lastName><xsl:value-of select="prezime"/></lastName>
</contact>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

I kako sad da ja to pokrenem? :) Mislim da treba ovako da napisem xsl file ali ne znam kako sad da ja to pokrenem pa da dobijem neki novi xml file koji izgleda onako kao sto sam naveo da treba da izgleda.

Pozdrav

[Ovu poruku je menjao dejanos dana 19.04.2006. u 15:01 GMT+1]

[Ovu poruku je menjao dejanos dana 19.04.2006. u 15:05 GMT+1]
Ostojic Dejan
19.04.2006. u 14:01 

Dragi Tata

Član broj: 1958
Poruke: 3899
*.lionbridge.com.

Sajt: www.novetehnologije.com


Profil

icon Re: XML Transform to XML with XSL19.04.2006. u 14:21
Treba ti neki XSLT procesor kao što je npr SAXON. A možeš da koristiš i običan web browser sa ugrađenom XSLT podrškom.
19.04.2006. u 14:21 

jablan
Mladen Jablanović
Beograd

Član broj: 8286
Poruke: 3334
*.yubc.net.

Sajt: blog.radioni.ca


Profil

icon Re: XML Transform to XML with XSL19.04.2006. u 14:49
Ili npr. besplatni tekst editor sa plaginom za XSLT.
19.04.2006. u 14:49 

blaza

Član broj: 961
Poruke: 739
*.vdial.verat.net.



Profil

icon Re: XML Transform to XML with XSL19.04.2006. u 16:15
Ako koristis integrisanu podrsku web browser-a, npr. IE-ov MSXML, a pri tome ne zelis da rezultat renderujes unutar prozora browser-a, moras pribeci triku:
npr. http://www.cranesoftwrights.com/resources/debugmsxml/
XML fajlu dodeli .xml ekstenziju.
XSL fajlu dodeli .xsl ekstenziju.
Napravi potreban .bat i .js fajl.
Pokreni .bat i prosledi imena XML fajla, XSL fajla, i ime izlanog fajla.
If you want to argue with me, learn to google faster.
19.04.2006. u 16:15 

jablan
Mladen Jablanović
Beograd

Član broj: 8286
Poruke: 3334
*.yubc.net.

Sajt: blog.radioni.ca


Profil

icon Re: XML Transform to XML with XSL19.04.2006. u 16:25
Moderatori, ovo bi moglo u TOP teme...
19.04.2006. u 16:25 

hakiro

Član broj: 27737
Poruke: 80
194.106.186.*



Profil

icon Re: XML Transform to XML with XSL27.04.2006. u 22:06
ili altova xmlspy
odlican je , toplo ga preporucujem
code je haiku
27.04.2006. u 22:06 

MilosBGRD1969

Član broj: 63956
Poruke: 76
*.adsl.sezampro.yu.



Profil

icon Re: XML Transform to XML with XSL11.05.2006. u 22:30
Odlican je Cooktop, a free je: http://www.simtel.net/pub/pd/53216.html
11.05.2006. u 22:30 

[es] :: XML :: XML Transform to XML with XSL

[ Pregleda: 1972 | Odgovora: 6 ]

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.