Posts Tagged ‘xml’

How to stop XSLT from escaping XML in output

Tuesday, September 28th, 2010

I was asked by a colleague today how to prevent XSLT from escaping XML “special characters” in its output. i.e. < was being escaped to &lt ;. I didn't know but somebody else did...

<xsl:value-of select=”somethingWhichContainsXml” />

should be 

<xsl:value-of select=”somethingWhichContainsXml” disable-output-escaping=”yes” />

Tags: ,
Posted in Development, How to's | No Comments »

JAXB @XmlAnyElement example

Monday, June 7th, 2010

The problem

I was recently working on a JAXB centric app which was required to capture “arbitary” xml. e.g.

<a> 
   <b></b> 
   <c></c> 
   <d> 
       <!-- "Unknown" XML here --> 
       <maybee></maybee> 
       <maybef></maybef> 
       <!-- etc etc --> 
   <d></d> 
</d></a> 

How could I ever capture the contents of if they could be “anything”?
(more…)

Tags: , , ,
Posted in Development, quick tips | No Comments »

How to convert a CLOB to an XMLType in Oracle

Thursday, June 3rd, 2010

Not much comment to add here; code says it all

PROCEDURE clobToXMLType(myClob IN CLOB)

IS
    l_xmlType XMLTYPE;
    -- do something
BEGIN
    l_xmltype := XMLTYPE.createXML(myClob);
  
EXCEPTION

    WHEN OTHERS THEN
    	RAISE;

END clobToXMLType;

Tags: , ,
Posted in Development, quick tips | 1 Comment »