HotScripts.pl - darmowe programy, skrypty  

Wróć   HotScripts.pl - darmowe programy, skrypty > Grupy dyskusyjne > pl.comp > pl.comp.programming

Odpowiedz
 
LinkBack Narzędzia wątku Wygląd
  #1 (permalink)  
Stary 24-05-2006, 00:19
Maciej Sobczak
Guest
 
Postów: n/a
Domyślnie XSLT, HTML i CDATA

Witam,

Jest plik XML, chciałbym go przerobić na plik HTML.
Najprostszy szkielet transformaty XSLT wygląda tak (wygenerowany przez
XEmacs przy tworzeniu nowego pliku .xsl):

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

<xsl:output method="html"/>

<xsl:template match="/">
<html>
<body>
</body>
</html>
</xsl:template>

</xsl:stylesheet>

A teraz chciałbym, żeby wynikowy plik HTML miał też definicję DOCTYPE.
Naiwne wrzucenie <!DOCTYPE ...> przed <html> powyżej powoduje, że
procesor zgłasza błąd "invalid element name" na znaku '!'.

Próba użycia CDATA:

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

<xsl:output method="html"/>

<xsl:template match="/">
<![CDATA[<!DOCTYPE ...>]]>
<html>
<body>
</body>
</html>
</xsl:template>

</xsl:stylesheet>

daje taki wynik:

&lt;!DOCUMENT ...&gt;<html><body></body></html>

Czyli nawiasy trójkątne są *automatycznie* tłumaczone na &lt; i &gt;,
pomimo tego, że były użyte w CDATA.

Co tu się dzieje?

Jako procesora XSLT używam xsltproc.


--
Maciej Sobczak : http://www.msobczak.com/
Programming : http://www.msobczak.com/prog/
Reply With Quote
  #2 (permalink)  
Stary 24-05-2006, 00:19
Piotr Duda
Guest
 
Postów: n/a
Domyślnie Re: XSLT, HTML i CDATA

Maciej Sobczak napisał(a):
> Witam,
>
> Jest plik XML, chciałbym go przerobić na plik HTML.
> Najprostszy szkielet transformaty XSLT wygląda tak (wygenerowany przez
> XEmacs przy tworzeniu nowego pliku .xsl):
>
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
>
> <xsl:output method="html"/>
>
> <xsl:template match="/">
> <html>
> <body>
> </body>
> </html>
> </xsl:template>
>
> </xsl:stylesheet>
>
> A teraz chciałbym, żeby wynikowy plik HTML miał też definicję DOCTYPE.
> Naiwne wrzucenie <!DOCTYPE ...> przed <html> powyżej powoduje, że
> procesor zgłasza błąd "invalid element name" na znaku '!'.
>


Bo deklaracje !DOCTYPE powinieneś dać w <xsl:output ...>
np tak:
<xsl:output method="html" doctype-public="....">
albo tak
<xsl:output method="html" doctype-system="....">
albo jeszcze tak
<xsl:output method="html" doctype-public="...." doctype-system="....">
zależnie od tego co potrzebujesz

szczegóły tu: http://www.w3.org/TR/xslt#output

--
Piotr Duda
"Inochi wa sutete mo Otoko wo suteru ki wa nakatta wai!"
Reply With Quote
  #3 (permalink)  
Stary 24-05-2006, 00:20
Maciej Sobczak
Guest
 
Postów: n/a
Domyślnie Re: XSLT, HTML i CDATA

Piotr Duda wrote:

> Bo deklaracje !DOCTYPE powinieneś dać w <xsl:output ...>
> np tak:
> <xsl:output method="html" doctype-public="....">
> albo tak
> <xsl:output method="html" doctype-system="....">
> albo jeszcze tak
> <xsl:output method="html" doctype-public="...." doctype-system="....">
> zależnie od tego co potrzebujesz
>
> szczegóły tu: http://www.w3.org/TR/xslt#output


Bingo, dziękuję. Dla potomnych - użyłem takiego zestawu (xml zamiast
html, bo się zatykało na walidatorze):

<xsl:output method="xml"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
encoding="ISO-8859-1"
omit-xml-declaration="yes" />


--
Maciej Sobczak : http://www.msobczak.com/
Programming : http://www.msobczak.com/prog/
Reply With Quote
  #4 (permalink)  
Stary 08-03-2007, 21:01
Początkujący
 
Zarejestrowany: Mar 2007
Postów: 0
Realiusingus jest na dobrej drodze
Post Best sites!

http://online-gambling.erw1r.info
http://soma.eoe1o.info
http://escorts.lll1l.info
http://bankruptcy-lawyer.eoe1o.info
http://loan.lll1l.info
http://gmac-mortgage.erw1r.info
http://bankruptcy-attorney.eoe1o.info
http://cash-loan.lll1l.info
http://tax-attorney.lll1l.info
http://domain-registerpersonal-injury.erw1r.info
http://car-accident-attorney.erw1r.info
http://loan-refinance.eoe1o.info
http://mortgage-application.lll1l.info
http://ameriquest.erw1r.info
http://refinance.eoe1o.info
http://criminal-defense-attorney.lll1l.info
http://real-estate.erw1r.info
http://work-at-home.eoe1o.info
http://music-download.lll1l.info
http://travel.erw1r.info
http://bankruptcy-attorney-california.lll1l.info
http://mortgage-companies.erw1r.info
http://auto-accident-attorney.erw1r.info
http://fargo-refinance.eoe1o.info
http://register-domain-names.lll1l.info
http://ephedra.erw1r.info
http://personal-injury-attorney.eoe1o.info
http://low-mortgage-rate.lll1l.info
http://freecreditreport.erw1r.info
http://refinance-new-york.eoe1o.info
http://medical-malpractice-attorneys.eoe1o.info
http://health-insurance.lll1l.info
http://medical-malpractice-lawyer.erw1r.info
http://xanax.eoe1o.info
http://vicodin.lll1l.info
http://hydrocodone-692.erw1r.info
http://mesothelioma.eoe1o.info
http://online-pharmacy.lll1l.info
http://viagra.erw1r.info
http://phentermine.eoe1o.info
http://poker.erw1r.info
http://cash-loan.eoe1o.info
http://online-poker.lll1l.info
http://car-insurance-quote.lll1l.info
http://casinos.lll1l.info
http://home-equity-loans.lll1l.info
http://auto-insurance.lll1l.info
http://hotels.lll1l.info
http://web-hosting.lll1l.info
http://airline-tickets.erw1r.info
Reply With Quote
  #6 (permalink)  
Stary 13-03-2007, 22:51
Początkujący
 
Zarejestrowany: Mar 2007
Postów: 0
gvataler jest na dobrej drodze
Post Sites

Best sites of Internet!

http://vivian-cash.erw1r.info/
http://nikki-cash.lll1l.info/
http://nikki-cash.lll1l.info/
http://quick-cash-loan.lll1l.info/
http://johnny-and-june-cash.erw1r.info/
http://roseanne-cash.eoe1o.info/
http://cash-america.eoe1o.info/
http://johnny-cash-hurt.erw1r.info/
http://cash-fast-loa.lll1l.info/
http://cash-flow-game.lll1l.info/
http://cash-converter.lll1l.info/
http://emergency-cash.erw1r.info/
http://ca-cash-rd.erw1r.info/
http://cash-flow-note.lll1l.info/
http://cash-advance-america.eoe1o.info/
http://blog-cash-click-content-free-...ey.eoe1o.info/
http://twinks-for-cash.erw1r.info/
http://johnny-cash-song.lll1l.info/
http://cash-for-annuity.lll1l.info/
http://cash-flow-statement.erw1r.info/
http://johnny-cash-tab.erw1r.info/
http://cash-back.erw1r.info/
http://cash-out.eoe1o.info/
http://pos-cash-register.eoe1o.info/
http://personal-cash-loan.eoe1o.info/
http://johnny-cash-and-june-carter-cash.lll1l.info/
http://cash-flow-101.lll1l.info/
http://cash-and-carry.erw1r.info/
http://cash-drawer.erw1r.info/
http://cash-warren.eoe1o.info/
http://online-casino.lll1l.info/
http://auto-insurance.erw1r.info/
http://airline-tickets.lll1l.info/
http://online-poker.erw1r.info/
http://mortgage-refinance.eoe1o.info/
http://bankruptcy-lawyer.erw1r.info/
http://free-porn.erw1r.info/
http://home-equity-loan.eoe1o.info/
http://sex-chat.lll1l.info/
http://refinancing.erw1r.info/
http://health-insurance.eoe1o.info/
http://va-refinance.eoe1o.info/
http://bankruptcy-car-loan.lll1l.info/
http://find-a-lawyer.eoe1o.info/
http://debt-consolidation.lll1l.info/
http://whole-life-insurance.eoe1o.info/
http://car-rental.erw1r.info/
http://personal-loans.erw1r.info/
http://adult-personals.eoe1o.info/
http://web-hosting.erw1r.info/
http://online-gambling.lll1l.info/
http://mortgage-loan.eoe1o.info/
http://mortgage-refinance-rate.eoe1o.info/
http://bankruptcy.lll1l.info/
http://work-at-home.lll1l.info/
http://mortgage-loans.erw1r.info/
http://credit-card-debt.lll1l.info/
http://home-equity-loans.eoe1o.info/
http://replica-rolex.lll1l.info/
http://car-insurance.erw1r.info/
http://mesothelioma.erw1r.info/
http://online-pharmacy.eoe1o.info/
http://adult-dating.lll1l.info/
http://mortgage-lenders.eoe1o.info/
http://personal-injury.erw1r.info/
http://wrongful-death.eoe1o.info/
http://texas-refinance.lll1l.info/
http://refinance-leads.lll1l.info/
http://personal-injury-attorney.erw1r.info/
http://criminal-defense-attorney.erw1r.info/
http://live-sex-cam.eoe1o.info/
http://refinance-rental-property.eoe1o.info/
http://malignant-mesothelioma.eoe1o.info/
http://medical-malpractice-lawyer.lll1l.info/
http://auto-accident-attorney.lll1l.info/
http://california-mortgage-rates.erw1r.info/
http://low-mortgage-rate.erw1r.info/
http://how-to-register-a-domain-name.erw1r.info/
http://epocrates.lll1l.info/
http://mortgage-companies.lll1l.info/
http://tax-attorney.eoe1o.info/
http://consolidate-loans.lll1l.info/
http://equity-mortgage.lll1l.info/
http://countrywide.lll1l.info/
http://what-is-mesothelioma.eoe1o.info/
http://ameriquest-mortgage.erw1r.info/
http://mortgage-application.eoe1o.info/
http://mortgage-note.lll1l.info/
http://best-refinance.erw1r.info/
http://florida-lawyer.erw1r.info/
http://car-accident-attorney.lll1l.info/
http://los-angeles-lawyer.eoe1o.info/
http://domain-register.lll1l.info/
http://refinancing-mortgage.eoe1o.info/
http://fargo-refinance.erw1r.info/
http://real-estate.lll1l.info/
http://bankruptcy-mortgage.eoe1o.info/
http://medical-malpractice-attorneys.erw1r.info/
http://payday-loan.lll1l.info/
http://re-mortgage.eoe1o.info/
http://mesothelioma-texas.lll1l.info/
http://mesothelioma-texas.lll1l.info/
http://register-domain-names.erw1r.info/
http://car-accident-lawyer.erw1r.info/
http://gmac-mortgage.eoe1o.info/
http://freecreditreport.lll1l.info/
http://mesothelioma-lawyers.eoe1o.info/
http://adult-dating.eoe1o.info/
http://teen-sex.erw1r.info/
http://women.eoe1o.info/
http://lesbian.lll1l.info/
http://music-download.eoe1o.info/
http://anal.lll1l.info/
http://teen.erw1r.info/
http://sex-videos.eoe1o.info/
http://travel.lll1l.info/
http://dating.eoe1o.info/
http://adult-personals.erw1r.info/
http://live-sex-cam.lll1l.info/
http://free-sex.erw1r.info/
Reply With Quote
  #7 (permalink)  
Stary 14-03-2007, 10:08
Początkujący
 
Zarejestrowany: Mar 2007
Postów: 0
popuoris jest na dobrej drodze
Post The best

All best sites:

weight loss pills
adult dating
poker
debt consolidation
online poker
refinance
phentermine
auto insurance
replica rolex
canadian pharmacy
carnival cruises
life insurance
sex in windsor ontario
viagra
replica handbag
sex
free porn
mortgage refinance
car buying guide
sex chat
mortgage
toys
adipex
job kingsport tennessee
debt consolidation loans
refinance mortgage loan
loan
hair loss
tramadol
casino
insurance
mesothelioma
web hosting
home equity loan
online pharmacy
walden university online degree
american online email
refinancing mortgage
mortgage refinance rate
cash advance online
bankruptcy attorney california
home mortgage
mortgage lenders
online degree
mortgage loan
health insurance
mortgage rates
personal loans
webcam chat
airline tickets
debt consolidation loan
vicodin
online college
porn
buy watch wrist
dating
online casino
hotels
soma
personal injury attorney
online education
poem romantic urdu
travel
florida bankruptcy lawyer
hydrocodone
car rental
business
bankruptcy
gifts
music download
bad credit home loan
bonds
xanax
free sex
escrow online service
small business loans women
toy
lose weight
help
florida lawyer
credit card debt
bankruptcy lawyer
students loan
home equity loans
utah mortgage
criminal defense attorney
va refinance
forex trading
ameriquest mortgage
nursing
find a lawyer
free tramadol
tobacco
used cars
mortgage loans
sex videos
group sex
mortgages
business marketing plan sales
car insurance
Reply With Quote
Odpowiedz


Użytkownicy aktualnie czytający ten wątek: 1 (0 użytkownik i 1 gości)
 
Narzędzia wątku
Wygląd

Zasady Postowania
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Włączony
UśmieszkiWłączony
[IMG] kod jest Wyłączony
HTML kod jest Wyłączony
Trackbacks are Włączony
Pingbacks are Włączony
Refbacks are Włączony


Podobne wątki
Wątek Autor wątku Forum Odpowiedzi Ostatni Post
poczta w formacie html dd pl.comp.lang.php 3 13-03-2006 11:18
[XSLT] jak przekazac znaczniki przez transformacje XSLT? adas; pl.comp.xml 10 31-01-2006 10:32
Wstawianie kodu HTML do JEditorPane wish pl.comp.lang.java 2 06-01-2006 09:05
Advanced HTML Editor michal1-1991 Szukam skryptu 0 04-01-2006 14:34
[.NET2003] Dynamiczny interfejs uzytkownika w html lub xaml Jarek Mielcarek pl.comp.lang.vbasic 0 09-12-2005 20:03


Czasy w strefie GMT +1. Teraz jest 12:37.


Oprogramowanie Forum: vBulletin 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0