È possibile utilizzare XSLT per trasformare XML in qualcosa di diverso da XML?XSLT: trasformazione in contenuto non-xml?
ad es. voglio la finale contenuti non XML:
<Content>
<image url="file1.png">
<image url="file2.png">
...
<image url="filen.png">
<EndContent>
Non Sei preavviso questo documento non è XML (o anche html), ma ha <elements>
.
E 'possibile, utilizzando XSLT, generare output non xml?
Un altro esempio di uscita non XML potrebbe essere:
<HTML>
<BODY>
<IMG src="file1.png"><BR>
<IMG src="file2.png"><BR>
...
<IMG src="filen.png"><BR>
</BODY>
</HTML>
Noterete questo documento è HTML, perché in HTML IMG
e BR
tag sono proibito da avere una chiusura etichetta. Questo costruisce con xhtml, la riformulazione dell'HTML usando xml, in cui tutti gli elementi sono richiesti dall'avere un tag di chiusura (perché in xml ogni tag deve essere chiuso).
Un altro esempio di uscita non XML potrebbe essere:
INSERT INTO Documents (Filename) VALUES ('file1.png')
INSERT INTO Documents (Filename) VALUES ('file2.png')
...
INSERT INTO Documents (Filename) VALUES ('file3.png')
posso fare qualsiasi sorgente XML mi piace, ma un esempio potrebbe essere:
xml Fonte:
<DocumentStore>
<Document type="image">file1.png</Document>
<Document type="image">file2.png</Document>
<Document type="image">filen.png</Document>
</DocumentStore>
Oppure:
<Profiles>
<User avatar="file1.png" />
<User avatar="file2.png" />
<User avatar="filen.png" />
</Profiles>
Cosa c'è di sbagliato con '' e ''
? – kennytm
@KennyTM: HTML non consente la chiusura dei tag su IMG e BR. Non è che i tag di chiusura siano offensivi. È solo che l'HTML corretto non li avrà. –