Jump to content

Extracting text from CDATA section of XML using XSLT


Recommended Posts

Hi thereI'm not a programmer, but need some help to find a way of displaying text in the CDATA section of an XML file using XSL. Or if there is an alternative to using XSL then I'm all ears (eyes?). Take, for example, the following line of my XML file:

<property id="instruction1" media="screen"><![CDATA[<p>Select the <span class="bold">option</span> you think is correct.</p>]]></property>

I ONLY want to display the text between the 'p' tags, i.e. "Select the option you think is correct." The formatting 'span' tag can be included if necessary, just as long as the 'p' tags are not displayed. Is this possible?

 

Edit: I should clarify that I would like to create an XSL to use to display the XML content in a browser window.

The full XML file is attached if required.

 

Thanks a lotNiall

01_01_005.xml

Edited by niallok
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...