XMLTRANSFORM
Sintassi
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> XMLTRANSFORM[XMLTRANSFORM]:::quoted
XMLTRANSFORM --> End((END))
Scopo
La funzione SQL XMLTRANSFORM applica un foglio di stile XSL all'istanza XML.
Vedi anche XMLCOMMENT, XMLDECODE, XMLELEMENT, XMLENCODE e XMLFORMAT.
Parametri:
- XML (
varchar2): istanza di tipo XML da trasformare con il foglio di stile XSL. - Foglio di stile (
varchar2): il foglio di stile XSL da applicare.
Restituisce: l'istanza XML con il foglio di stile applicato.
Esempi
L'esempio seguente estrae il valore dell'elemento name da un'istanza XML utilizzando un foglio di stile XSL:
select xmltransform
( '<?xml version="1.0"?><name>peter</name>'
, '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:output method="html" indent="yes"/><xsl:template match="/"><xsl:value-of select="name"/></xsl:template></xsl:stylesheet>'
)
-------------------
peter
L'esempio seguente estrae il valore dell'elemento first-name da un'istanza XML contenente più elementi figli utilizzando un foglio di stile XSL:
select xmltransform
( '<?xml version="1.0"?><r><name>peter overlap</name><first-name>peter</first-name></r>'
, '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:output method="html" indent="yes"/><xsl:template match="/r"><xsl:value-of select="first-name"/></xsl:template></xsl:stylesheet>'
)
-------------------
peter