Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 17th, 2009, 10:08 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

Using xmlns="http://www.w3.org/2001/XMLSchema" in your stylesheet helps if you want to create result elements in that namespace. It does not help to select or match elements in that namespace.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
The Following User Says Thank You to Martin Honnen For This Useful Post:
chaostimmy (August 17th, 2009)
 
Old August 17th, 2009, 10:46 AM
Registered User
 
Join Date: Aug 2009
Posts: 6
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Martin Honnen View Post
Using xmlns="http://www.w3.org/2001/XMLSchema" in your stylesheet helps if you want to create result elements in that namespace. It does not help to select or match elements in that namespace.
Thats really good to know!



How can i avoid line breaks like this one at pmid text ??
Code:
<documentation>
<name>litReference</name>
<text>Reference to literature</text>
</documentation>
<documentation>
<name>pmid</name>
<text>
The PubMed identifier (http://www.pubmed.com) of an article
</text>
</documentation>
i tried:
replace(text(),'\s','')
replace(text(),'\n','')
normalice-space(text())
string(text())



okay problem is just the program i open it with, in real there are no whitespaces at all..
the output file is in one line

Last edited by chaostimmy; August 17th, 2009 at 12:07 PM..
 
Old August 17th, 2009, 12:06 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

Consider to start a new thread for a new question.

As for your question, if you have <xsl:template match="documentation"> meaning a 'documentation' element is your context element then <xsl:value-of select="normalize-space(text)"/> will output the normalized string value of the 'text' child element. That way any leading and trailing whitespace will be removed and any whitespace in between will be condensed to a single space.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog





Similar Threads
Thread Thread Starter Forum Replies Last Post
xslt and xsd leonid XSLT 1 August 17th, 2006 09:02 AM
XSLT to make multiple hyperlinked HTML files dai.hop XSLT 1 January 11th, 2006 03:05 PM
Merging XSD files in one XSD file by using what? haoxuqian XML 1 November 4th, 2005 01:42 PM
Validating Xml files with XSD file ShaileshShinde VB.NET 2002/2003 Basics 1 September 12th, 2005 07:00 AM
Transform .xsd files to a .xml file lxu XSLT 0 July 19th, 2004 09:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.