[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Manipulating CDATA contents [SEC=UNCLASSIFIED]

Subject: Re: Manipulating CDATA contents [SEC=UNCLASSIFIED]
From: Jeff Sese <jeferson.sese@xxxxxxxxxxxx>
Date: Wed, 18 Jun 2008 13:29:41 +0800
Re:  Manipulating CDATA contents    [SEC=UNCLASSIFIED]
If your using xslt 2.0, you can use xsl:analyze-string.

<xsl:template match="DefinitionCDATA">
	<xsl:analyze-string select="." regex="[&gt;]">
			<xsl:sequence select="."/><br/>
			<xsl:sequence select="."/>

On 06 18, 08, at 10:28 AM, Enrico.Raymund@xxxxxxxxxxx wrote:


I have an XSLT that converts XML to HTML:

XML Input:
      <![CDATA[ <xsd:sequence>
                  <xsd:element ref="tns:GivenName"/>
                  <xsd:element ref="tns:LastName"/>
                  <xs:element ref="tns:Address"/>
                  <xsd:element ref="tns:Telephone"/>
                  <xsd:element ref="tns:Email"/>

Current HTML Output:
&lt;xsd:element ref="tns:GivenName"/&gt;
&lt;xsd:element ref="tnsLastName"/&gt;
&lt;xs:element ref="tns:Address"/&gt;
&lt;xsd:element ref="tns:Telephone"/&gt;
&lt;xsd:element ref="tns:Email"/&gt;

which doesn't display nicely on a browser -- displayed without line breaks!

Desired HTML Output (not exactly pretty-print but at least line break at
the end of each xs: definition):
&lt;xsd:element ref="tns:GivenName"/&gt;<br/>
&lt;xsd:element ref="tnsLastName"/&gt;<br/>
&lt;xs:element ref="tns:Address"/&gt;<br/>
&lt;xsd:element ref="tns:Telephone"/&gt;<br/>
&lt;xsd:element ref="tns:Email"/&gt;<br/>

The help I need is to be able to insert "<br/>" after each ">" in the CDATA
content. I'll worry about the tabbing (pretty-printing) later.

Thanks in advance,

Enrico Raymundo
XML Architect
Technical Integration
Department of Immigration and Citizenship (DIAC)
The "G", 46-50 Hibberson Street
Gungahlin, ACT, 2912
Phone: (02) 6223 9604
Fax:  (02) 6223 9692

Important Notice: If you have received this email by mistake, please advise
the sender and delete the message and attachments immediately. This email,
including attachments, may contain confidential, sensitive, legally
privileged and/or copyright information. Any review, retransmission,
dissemination or other use of this information by persons or entities other
than the intended recipient is prohibited. DIAC respects your privacy and
has obligations under the Privacy Act 1988. The official departmental
privacy policy can be viewed on the department's website at www.immi.gov.au
See: http://www.immi.gov.au/functional/privacy.htm

Jeferson L. Sese jeferson dot sese at asiatype dot com Asiatype Inc. Suite 114 Columbia Tower Ortigas Ave., Greenhills Mandaluyong City 1550 Philippines Tel: +632-744-6262 Mobile: +63927-671-7901

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.