I have a simple XML file like this:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="01C3_OIZODEMO_certificato_v1.0.xsl"?>
<Certificato>
<TD:Global xmlns:TD="http://www.xxxx.org/TD_tags">
<TD:XSL_Def>
<TD:orig>http://www.xxxx.com/xsl/</TD:orig>
</TD:XSL_Def>
</TD:Global>
<TipoCert>Stato civile</TipoCert>
<Nominativo>Fenil Postume</Nominativo>
<DatiNascita>
<DataNas>01/01/2099</DataNas>
<Luogo>Perengana</Luogo>
<Atto>Atto n. 735 p.1 s.A u. 1</Atto>
</DatiNascita>
<Indirizzo>
<Via>Via Perengana</Via>
<NumeroCivico>0</NumeroCivico>
<Cap>99999</Cap>
<Frazione>NA</Frazione>
</Indirizzo>
<Testo>TEST</Testo>
<Data>22/12/2010</Data>
<Ora>10:48:00</Ora>
</Certificato>
How I can retrieve the filename “01C3_OIZODEMO_certificato_v1.0.xsl” using xml API in Java?
Thank you very much!!
Yes, try using
TransformerFactory.getAssociatedStylesheetmethod:Returns:
Another ways are:
SAX API:
DOM API:
In both cases result is same: