XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Evelyne HSubject: Process only certain tags and format them
Author: Evelyne H
Date: 20 Mar 2007 05:17 PM
I'm relatively new to xslt and would be happy if anyone could help me.
I have got a docbook xml-document with the following tags that I would like to extract (I just need that one tag (para and all its children) to do something non-docbook related with it)
<para condition="extract"> here is unformated <emphasis>text</emphasis> </para>

what I like is an xml with: here is unformated text.(with only one whitespace between two words and only the text of the other tags)
<title>, <section> (tags in the docbook xml) etc. are not of interest.
what is a good way to do that?
thanks in advance
Evelyne

Posttop
Tony LavinioSubject: Process only certain tags and format them
Author: Tony Lavinio
Date: 21 Mar 2007 01:26 PM
Originally Posted: 21 Mar 2007 01:25 PM
<?xml version="1.0" encoding="US-ASCII"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="US-ASCII"/>
<xsl:template match="/">
<xsl:copy-of select="//docbook/para[@condition = 'extract']/node()"/>
</xsl:template>
</xsl:stylesheet>

will get you the nested tags also.

Change the xsl:copy-of to xsl:value-of to get only the text.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.